public interface Variant<T> extends Supplier<T>, Comparable<Variant<?>>, Serializable
| Modifier and Type | Interface and Description |
|---|---|
static class |
Variant.Avro |
static class |
Variant.AvroBuilder |
static interface |
Variant.Builder<T> |
static class |
Variant.Comparator |
static class |
Variant.NativeImpl |
static class |
Variant.Protobuf |
static class |
Variant.ProtobufBuilder |
static class |
Variant.Thrift |
static class |
Variant.ThriftBuilder |
| Modifier and Type | Method and Description |
|---|---|
static Variant.Avro |
avro(Variant<?> instance)
Returns a wrapped Avro record based on an instance of Variant.
|
static Variant.Avro |
avro(VariantAvro wrapped)
Wraps an existing Avro record.
|
default int |
compareTo(Variant<?> other) |
T |
get()
Returns underlying object.
|
static Class<VariantAvro> |
getAvroClass()
Returns Avro record class.
|
static Schema |
getAvroSchema()
Returns Avro record schema.
|
boolean |
getBooleanVariant() |
Supplier<byte[]> |
getBytesVariant() |
static Comparator<Variant<?>> |
getComparator()
Returns comparator instance for Variant objects.
|
double |
getDoubleVariant() |
float |
getFloatVariant() |
int |
getIntVariant() |
long |
getLongVariant() |
static Class<NestedProtobuf.Variant> |
getProtobufClass()
Returns Protobuf class for this struct.
|
static com.google.protobuf.Descriptors.Descriptor |
getProtobufDescriptor()
Returns Protobuf descriptor for this struct.
|
static Class<NestedProtobuf> |
getProtobufProtocolClass()
Returns Protobuf protocol class for this struct.
|
static com.google.protobuf.Descriptors.FileDescriptor |
getProtobufProtocolDescriptor()
Returns Protobuf protocol descriptor for this struct.
|
String |
getStringVariant() |
static Class<VariantThrift> |
getThriftClass()
Returns Thrift class for this struct.
|
static Map<VariantThrift._Fields,FieldMetaData> |
getThriftMetadataMap()
Returns Thrift metadata map for this struct.
|
default boolean |
isDefault()
True if all fields are set to default values.
|
boolean |
isDefaultBooleanVariant() |
boolean |
isDefaultBytesVariant() |
boolean |
isDefaultDoubleVariant() |
boolean |
isDefaultFloatVariant() |
boolean |
isDefaultIntVariant() |
boolean |
isDefaultLongVariant() |
boolean |
isDefaultStringVariant() |
static Variant.NativeImpl |
nativeImpl(Variant<?> instance)
Returns a POJO based on an instance of Variant.
|
static Variant.Builder<VariantAvro> |
newAvroBuilder()
Returns new Avro builder instance with default values.
|
static Variant.Builder<VariantAvro> |
newAvroBuilder(Variant<?> other)
Returns new Avro builder instance based on existing prototype Variant.
|
static Variant.Builder<VariantAvro> |
newAvroBuilder(VariantAvro.Builder other)
Returns new Avro builder instance based on existing prototype builder.
|
static Variant.Builder<VariantAvro> |
newAvroBuilder(VariantAvro other)
Returns new Avro builder instance based on existing prototype.
|
Variant.Builder<T> |
newBuilder()
Creates a new builder based on this object.
|
static Variant.Builder<Variant.NativeImpl> |
newNativeImplBuilder()
Returns a POJO builder instance with default values.
|
static Variant.Builder<Variant.NativeImpl> |
newNativeImplBuilder(Variant<?> other)
Returns a POJO builder instance based on existing prototype Variant.
|
static Variant.Builder<NestedProtobuf.Variant> |
newProtobufBuilder()
Returns new Protobuf builder instance with default values.
|
static Variant.Builder<NestedProtobuf.Variant> |
newProtobufBuilder(NestedProtobuf.Variant other)
Returns new Protobuf builder instance based on existing prototype.
|
static Variant.Builder<NestedProtobuf.Variant> |
newProtobufBuilder(Variant<?> other)
Returns new Protobuf builder instance based on existing prototype Variant.
|
static Variant.Builder<VariantThrift> |
newThriftBuilder()
Returns new Thrift builder instance with default values.
|
static Variant.Builder<VariantThrift> |
newThriftBuilder(Variant<?> other)
Returns new Thrift builder instance based on existing prototype Variant.
|
static Variant.Builder<VariantThrift> |
newThriftBuilder(VariantThrift other)
Returns new Thrift builder instance based on existing prototype.
|
static Variant.Protobuf |
protobuf(NestedProtobuf.Variant wrapped)
Wraps an existing Protobuf message.
|
static Variant.Protobuf |
protobuf(Variant<?> instance)
Returns a wrapped Protobuf message based on an instance of Variant.
|
static Variant.Thrift |
thrift(Variant<?> instance)
Returns a wrapped Thrift struct based on an instance of Variant.
|
static Variant.Thrift |
thrift(VariantThrift instance)
Creates a new wrapped Thrift struct copied from an existing instance.
|
default boolean isDefault()
Variant.Builder<T> newBuilder()
int getIntVariant()
boolean isDefaultIntVariant()
long getLongVariant()
boolean isDefaultLongVariant()
float getFloatVariant()
boolean isDefaultFloatVariant()
double getDoubleVariant()
boolean isDefaultDoubleVariant()
boolean getBooleanVariant()
boolean isDefaultBooleanVariant()
String getStringVariant()
boolean isDefaultStringVariant()
Supplier<byte[]> getBytesVariant()
boolean isDefaultBytesVariant()
static Comparator<Variant<?>> getComparator()
default int compareTo(Variant<?> other)
compareTo in interface Comparable<Variant<?>>static Variant.Builder<Variant.NativeImpl> newNativeImplBuilder()
static Variant.Builder<Variant.NativeImpl> newNativeImplBuilder(Variant<?> other)
static Variant.NativeImpl nativeImpl(Variant<?> instance)
static Variant.Builder<VariantAvro> newAvroBuilder()
static Variant.Builder<VariantAvro> newAvroBuilder(VariantAvro other)
static Variant.Builder<VariantAvro> newAvroBuilder(VariantAvro.Builder other)
static Variant.Builder<VariantAvro> newAvroBuilder(Variant<?> other)
static Variant.Avro avro(Variant<?> instance)
static Variant.Avro avro(VariantAvro wrapped)
static Class<VariantAvro> getAvroClass()
static Schema getAvroSchema()
static Variant.Builder<NestedProtobuf.Variant> newProtobufBuilder()
static Variant.Builder<NestedProtobuf.Variant> newProtobufBuilder(NestedProtobuf.Variant other)
static Variant.Builder<NestedProtobuf.Variant> newProtobufBuilder(Variant<?> other)
static Variant.Protobuf protobuf(Variant<?> instance)
static Variant.Protobuf protobuf(NestedProtobuf.Variant wrapped)
static Class<NestedProtobuf.Variant> getProtobufClass()
static Class<NestedProtobuf> getProtobufProtocolClass()
static com.google.protobuf.Descriptors.Descriptor getProtobufDescriptor()
static com.google.protobuf.Descriptors.FileDescriptor getProtobufProtocolDescriptor()
static Variant.Builder<VariantThrift> newThriftBuilder()
static Variant.Builder<VariantThrift> newThriftBuilder(VariantThrift other)
static Variant.Builder<VariantThrift> newThriftBuilder(Variant<?> other)
static Variant.Thrift thrift(Variant<?> instance)
static Variant.Thrift thrift(VariantThrift instance)
static Class<VariantThrift> getThriftClass()
static Map<VariantThrift._Fields,FieldMetaData> getThriftMetadataMap()
Copyright © 2013–2016 AdGear Technologies Inc.. All rights reserved.