Class Schema

    • Method Detail

      • sorted

        public Schema sorted()
        Returns an identical Schema with sorted fields.
      • withOptions

        public Schema withOptions​(Schema.Options options)
        Returns a copy of the Schema with the options set.
      • setUUID

        public void setUUID​(java.util.UUID uuid)
        Set this schema's UUID. All schemas with the same UUID must be guaranteed to be identical.
      • getEncodingPositions

        public java.util.Map<java.lang.String,​java.lang.Integer> getEncodingPositions()
        Gets the encoding positions for this schema.
      • isEncodingPositionsOverridden

        public boolean isEncodingPositionsOverridden()
        Returns whether encoding positions have been explicitly overridden.
      • setEncodingPositions

        public void setEncodingPositions​(java.util.Map<java.lang.String,​java.lang.Integer> encodingPositions)
        Sets the encoding positions for this schema.
      • getUUID

        public @Nullable java.util.UUID getUUID()
        Get this schema's UUID.
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Returns true if two Schemas have the same fields in the same order.
        Overrides:
        equals in class java.lang.Object
      • typesEqual

        public boolean typesEqual​(Schema other)
        Returns true if two schemas are equal ignoring field names and descriptions.
      • equivalent

        public boolean equivalent​(Schema other)
        Returns true if two Schemas have the same fields, but possibly in different orders.
      • assignableTo

        public boolean assignableTo​(Schema other)
        Returns true if this Schema can be assigned to another Schema. *
      • assignableToIgnoreNullable

        public boolean assignableToIgnoreNullable​(Schema other)
        Returns true if this Schema can be assigned to another Schema, ignoring nullable. *
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

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

        public java.util.List<Schema.Field> getFields()
      • getFieldNames

        public java.util.List<java.lang.String> getFieldNames()
        Return the list of all field names.
      • getField

        public Schema.Field getField​(int index)
        Return a field by index.
      • getField

        public Schema.Field getField​(java.lang.String name)
      • indexOf

        public int indexOf​(java.lang.String fieldName)
        Find the index of a given field.
      • hasField

        public boolean hasField​(java.lang.String fieldName)
        Returns true if fieldName exists in the schema, false otherwise.
      • nameOf

        public java.lang.String nameOf​(int fieldIndex)
        Return the name of field by index.
      • getFieldCount

        public int getFieldCount()
        Return the count of fields.