Package cz.o2.proxima.core.scheme
Class SchemaDescriptors
- java.lang.Object
-
- cz.o2.proxima.core.scheme.SchemaDescriptors
-
public class SchemaDescriptors extends java.lang.Object
SchemaDescriptors for types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SchemaDescriptors.ArrayTypeDescriptor<T>
Array type descriptor allows to use other descriptor as value.static class
SchemaDescriptors.EnumTypeDescriptor<T>
Enum type descriptor.static class
SchemaDescriptors.PrimitiveTypeDescriptor<T>
Primitive type descriptor with simple type (eq String, Long, Integer, etc).static interface
SchemaDescriptors.SchemaTypeDescriptor<T>
Generic type descriptor.static class
SchemaDescriptors.StructureTypeDescriptor<T>
Structure type descriptor allows to have fields with type as another descriptor.
-
Method Summary
-
-
-
Method Detail
-
primitives
public static <T> SchemaDescriptors.PrimitiveTypeDescriptor<T> primitives(AttributeValueType type)
CreateSchemaDescriptors.PrimitiveTypeDescriptor
for specificAttributeValueType
.- Type Parameters:
T
- descriptor type- Parameters:
type
- primitive type- Returns:
- primitive type descriptor.
-
enums
public static SchemaDescriptors.EnumTypeDescriptor<java.lang.String> enums(java.util.List<java.lang.String> values)
CreateSchemaDescriptors.EnumTypeDescriptor
forAttributeValueType.ENUM
type.- Parameters:
values
- possible values- Returns:
- enum type descriptor
-
strings
public static SchemaDescriptors.PrimitiveTypeDescriptor<java.lang.String> strings()
CreateSchemaDescriptors.PrimitiveTypeDescriptor
forString
.- Returns:
- Primitive type descriptor
-
bytes
public static SchemaDescriptors.ArrayTypeDescriptor<byte[]> bytes()
CreateSchemaDescriptors.ArrayTypeDescriptor
for byte array.- Returns:
- Array type descriptor
-
integers
public static SchemaDescriptors.PrimitiveTypeDescriptor<java.lang.Integer> integers()
CreateSchemaDescriptors.PrimitiveTypeDescriptor
forInteger
.- Returns:
- Primitive type descriptor
-
longs
public static SchemaDescriptors.PrimitiveTypeDescriptor<java.lang.Long> longs()
CreateSchemaDescriptors.PrimitiveTypeDescriptor
forLong
.- Returns:
- Primitive type descriptor
-
doubles
public static SchemaDescriptors.PrimitiveTypeDescriptor<java.lang.Double> doubles()
CreateSchemaDescriptors.PrimitiveTypeDescriptor
forDouble
.- Returns:
- Primitive type descriptor
-
floats
public static SchemaDescriptors.PrimitiveTypeDescriptor<java.lang.Float> floats()
CreateSchemaDescriptors.PrimitiveTypeDescriptor
forFloat
.- Returns:
- Primitive type descriptor
-
booleans
public static SchemaDescriptors.PrimitiveTypeDescriptor<java.lang.Boolean> booleans()
CreateSchemaDescriptors.PrimitiveTypeDescriptor
forBoolean
.- Returns:
- Primitive type descriptor
-
arrays
public static <T> SchemaDescriptors.ArrayTypeDescriptor<T> arrays(SchemaDescriptors.SchemaTypeDescriptor<T> valueDescriptor)
- Type Parameters:
T
- value type- Parameters:
valueDescriptor
- primitive type- Returns:
- Array type descriptor
-
structures
public static <T> SchemaDescriptors.StructureTypeDescriptor<T> structures(java.lang.String name)
CreateSchemaDescriptors.StructureTypeDescriptor
with name- Type Parameters:
T
- structure type- Parameters:
name
- structure name- Returns:
- Structure type descriptor
-
structures
public static <T> SchemaDescriptors.StructureTypeDescriptor<T> structures(java.lang.String name, java.util.Map<java.lang.String,SchemaDescriptors.SchemaTypeDescriptor<?>> fields)
CreateSchemaDescriptors.StructureTypeDescriptor
with fields.- Type Parameters:
T
- structure type- Parameters:
name
- structure namefields
- fields- Returns:
- Structure type descriptor
-
-