Class Schema.EntriesOrder
- java.lang.Object
-
- org.talend.sdk.component.api.record.Schema.EntriesOrder
-
- All Implemented Interfaces:
Comparator<Schema.Entry>
- Enclosing interface:
- Schema
public static class Schema.EntriesOrder extends Object implements Comparator<Schema.Entry>
-
-
Constructor Summary
Constructors Constructor Description EntriesOrder(Iterable<String> fields)
EntriesOrder(String fields)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(Schema.Entry e1, Schema.Entry e2)
Comparator<Schema.Entry>
getComparator()
Stream<String>
getFieldsOrder()
Schema.EntriesOrder
moveAfter(String after, String name)
Move a field after another one.Schema.EntriesOrder
moveBefore(String before, String name)
Move a field before another one.static Schema.EntriesOrder
of(Iterable<String> fields)
Build an EntriesOrder according fields.static Schema.EntriesOrder
of(String fields)
Build an EntriesOrder according fields.Schema.EntriesOrder
swap(String name, String with)
Swap two fields.String
toFields()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
EntriesOrder
public EntriesOrder(String fields)
-
EntriesOrder
public EntriesOrder(Iterable<String> fields)
-
-
Method Detail
-
of
public static Schema.EntriesOrder of(String fields)
Build an EntriesOrder according fields.- Parameters:
fields
- the fields ordering. Each field should be,
separated.- Returns:
- the order EntriesOrder
-
of
public static Schema.EntriesOrder of(Iterable<String> fields)
Build an EntriesOrder according fields.- Parameters:
fields
- the fields ordering.- Returns:
- the order EntriesOrder
-
getFieldsOrder
public Stream<String> getFieldsOrder()
-
moveAfter
public Schema.EntriesOrder moveAfter(String after, String name)
Move a field after another one.- Parameters:
after
- the field name referencename
- the field name- Returns:
- this EntriesOrder
-
moveBefore
public Schema.EntriesOrder moveBefore(String before, String name)
Move a field before another one.- Parameters:
before
- the field name referencename
- the field name- Returns:
- this EntriesOrder
-
swap
public Schema.EntriesOrder swap(String name, String with)
Swap two fields.- Parameters:
name
- the field namewith
- the other field- Returns:
- this EntriesOrder
-
getComparator
public Comparator<Schema.Entry> getComparator()
-
compare
public int compare(Schema.Entry e1, Schema.Entry e2)
- Specified by:
compare
in interfaceComparator<Schema.Entry>
-
-