com.linkedin.data.schema
Class DataSchema

java.lang.Object
  extended by com.linkedin.data.schema.DataSchema
Direct Known Subclasses:
ComplexDataSchema, PrimitiveDataSchema

public abstract class DataSchema
extends java.lang.Object

DataSchema represents an schema.


Nested Class Summary
static class DataSchema.Type
          Possible types for a DataSchema.
 
Constructor Summary
protected DataSchema(DataSchema.Type type)
          Constructor.
 
Method Summary
abstract  boolean equals(java.lang.Object other)
           
 DataSchema getDereferencedDataSchema()
          Return the dereferenced DataSchema by following typerefs.
 DataSchema.Type getDereferencedType()
          Return the dereferenced native type by following typerefs.
abstract  java.util.Map<java.lang.String,java.lang.Object> getProperties()
          Return the properties of the DataSchema.
 DataSchema.Type getType()
          Return the type of the DataSchema.
abstract  java.lang.String getUnionMemberKey()
          Return the union member key for this DataSchema.
abstract  boolean hasError()
          Return whether the DataSchema has one or more errors.
abstract  int hashCode()
           
 boolean isComplex()
          Return whether type is a complex type.
abstract  boolean isPrimitive()
          Return whether type is a primitive type.
 java.lang.String toString()
          Print the DataSchema to JSON with space between fields, items, names, values, ...
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSchema

protected DataSchema(DataSchema.Type type)
Constructor.

Parameters:
type - of the DataSchema.
Method Detail

getType

public DataSchema.Type getType()
Return the type of the DataSchema.

Returns:
the type of the DataSchema.

getDereferencedType

public DataSchema.Type getDereferencedType()
Return the dereferenced native type by following typerefs. Should never return DataSchema.Type.TYPEREF.

Returns:
the dereferenced native type by following typerefs.

getDereferencedDataSchema

public DataSchema getDereferencedDataSchema()
Return the dereferenced DataSchema by following typerefs. Should never return a TyperefDataSchema.

Returns:
the dereferenced DataSchema by following typerefs.

hasError

public abstract boolean hasError()
Return whether the DataSchema has one or more errors.

Returns:
whether the DataSchema has one or more errors.

isPrimitive

public abstract boolean isPrimitive()
Return whether type is a primitive type.

Returns:
true if type is a primitive type.

isComplex

public boolean isComplex()
Return whether type is a complex type.

Returns:
true if type is a complex type.

getProperties

public abstract java.util.Map<java.lang.String,java.lang.Object> getProperties()
Return the properties of the DataSchema. Properties will be empty for non-complex types.

Returns:
the properties of the DataSchema.

getUnionMemberKey

public abstract java.lang.String getUnionMemberKey()
Return the union member key for this DataSchema. This key is used to uniquely identify a member of the union following the Avro specification.

Returns:
the union member key for this DataSchema.

toString

public java.lang.String toString()
Print the DataSchema to JSON with space between fields, items, names, values, ... etc.

Overrides:
toString in class java.lang.Object
Returns:
JSON representation of DataSchema.

equals

public abstract boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object

hashCode

public abstract int hashCode()
Overrides:
hashCode in class java.lang.Object