Class UserType

    • Field Detail

      • keyspace

        public final java.lang.String keyspace
      • name

        public final java.nio.ByteBuffer name
    • Constructor Detail

      • UserType

        public UserType​(java.lang.String keyspace,
                        java.nio.ByteBuffer name,
                        java.util.List<FieldIdentifier> fieldNames,
                        java.util.List<AbstractType<?>> fieldTypes,
                        boolean isMultiCell)
    • Method Detail

      • isUDT

        public boolean isUDT()
        Overrides:
        isUDT in class AbstractType<java.nio.ByteBuffer>
      • fieldTypes

        public java.util.List<AbstractType<?>> fieldTypes()
      • fieldNameAsString

        public java.lang.String fieldNameAsString​(int i)
      • getNameAsString

        public java.lang.String getNameAsString()
      • nameComparator

        public ShortType nameComparator()
      • serializeForNativeProtocol

        public java.nio.ByteBuffer serializeForNativeProtocol​(java.util.Iterator<Cell<?>> cells,
                                                              ProtocolVersion protocolVersion)
      • toJSONString

        public java.lang.String toJSONString​(java.nio.ByteBuffer buffer,
                                             ProtocolVersion protocolVersion)
        Description copied from class: AbstractType
        Converts the specified value into its JSON representation.

        The buffer position will stay the same.

        Overrides:
        toJSONString in class TupleType
        Parameters:
        buffer - the value to convert
        protocolVersion - the protocol version to use for the conversion
        Returns:
        a JSON string representing the specified value
      • freezeNestedMulticellTypes

        public AbstractType<?> freezeNestedMulticellTypes()
        Description copied from class: AbstractType
        Returns an AbstractType instance that is equivalent to this one, but with all nested UDTs and collections explicitly frozen. This is only necessary for 2.x -> 3.x schema migrations, and can be removed in Cassandra 4.0. See CASSANDRA-11609 and CASSANDRA-11613.
        Overrides:
        freezeNestedMulticellTypes in class AbstractType<java.nio.ByteBuffer>
      • isValueCompatibleWith

        public boolean isValueCompatibleWith​(AbstractType<?> previous)
        Description copied from class: AbstractType
        Returns true if values of the other AbstractType can be read and "reasonably" interpreted by the this AbstractType. Note that this is a weaker version of isCompatibleWith, as it does not require that both type compare values the same way. The restriction on the other type being "reasonably" interpreted is to prevent, for example, IntegerType from being compatible with all other types. Even though any byte string is a valid IntegerType value, it doesn't necessarily make sense to interpret a UUID or a UTF8 string as an integer. Note that a type should be compatible with at least itself.
        Overrides:
        isValueCompatibleWith in class AbstractType<java.nio.ByteBuffer>
      • equals

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in interface java.util.Comparator<java.nio.ByteBuffer>
        Overrides:
        equals in class TupleType
      • withUpdatedUserType

        public UserType withUpdatedUserType​(UserType udt)
        Description copied from class: AbstractType
        Returns an instance of this type with all references to the provided user type recursively replaced with its new definition.
        Overrides:
        withUpdatedUserType in class TupleType
      • toString

        public java.lang.String toString()
        Description copied from class: AbstractType
        This must be overriden by subclasses if necessary so that for any AbstractType, this == TypeParser.parse(toString()). Note that for backwards compatibility this includes the full classname. For CQL purposes the short name is fine.
        Overrides:
        toString in class TupleType
      • toString

        public java.lang.String toString​(boolean ignoreFreezing)
        Overrides:
        toString in class AbstractType<java.nio.ByteBuffer>
        Parameters:
        ignoreFreezing - if true, the type string will not be wrapped with FrozenType(...), even if this type is frozen.
      • getCqlTypeName

        public java.lang.String getCqlTypeName()
      • elementKeyspace

        public java.lang.String elementKeyspace()
        Description copied from interface: SchemaElement
        Returns the CQL name of the keyspace to which this schema element belong.
        Specified by:
        elementKeyspace in interface SchemaElement
        Returns:
        the keyspace name.
      • elementName

        public java.lang.String elementName()
        Description copied from interface: SchemaElement
        Returns the CQL name of this schema element.
        Specified by:
        elementName in interface SchemaElement
        Returns:
        the name of this schema element.
      • toCqlString

        public java.lang.String toCqlString​(boolean withInternals,
                                            boolean ifNotExists)
        Description copied from interface: SchemaElement
        Returns a CQL representation of this element
        Specified by:
        toCqlString in interface SchemaElement
        Parameters:
        withInternals - if the internals part of the CQL should be exposed.
        ifNotExists - if "IF NOT EXISTS" should be included.
        Returns:
        a CQL representation of this element