Class Schema<T>


  • public class Schema<T>
    extends Object
    Specific version of a secondary index schema.
    • Method Detail

      • getVersion

        public final int getVersion()
      • getIndexFields

        public final com.google.common.collect.ImmutableMap<String,​IndexedField<T,​?>> getIndexFields()
      • getStoredFields

        public final com.google.common.collect.ImmutableSet<String> getStoredFields()
        Returns all fields in this schema where FieldDef.isStored() is true.
      • hasField

        public final boolean hasField​(SchemaFieldDefs.SchemaField<T,​?> field)
        Check whether a field is present in this schema.
        Parameters:
        field - field to look up.
        Returns:
        whether the field is present.
      • hasField

        public final boolean hasField​(String fieldName)
      • buildFields

        public final Iterable<Schema.Values<T>> buildFields​(T obj,
                                                            com.google.common.collect.ImmutableSet<String> skipFields)
        Build all fields in the schema from an input object.

        Null values are omitted, as are fields which cause errors, which are logged.

        Parameters:
        obj - input object.
        skipFields - set of field names to skip when indexing the document
        Returns:
        all non-null field values from the object.