UserType (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.db.marshal

## Class UserType

- java.lang.Object
- - org.apache.cassandra.db.marshal.AbstractType<java.nio.ByteBuffer>
  - - org.apache.cassandra.db.marshal.TupleType
    - - org.apache.cassandra.db.marshal.UserType

- All Implemented Interfaces:
    java.util.Comparator<java.nio.ByteBuffer>

      public class UserType
      extends TupleType

  A user defined type. A user type is really just a tuple type on steroids.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `java.lang.String` | `keyspace`
    `java.nio.ByteBuffer` | `name`

    - ### Fields inherited from class org.apache.cassandra.db.marshal.TupleType

      `types`

    - ### Fields inherited from class org.apache.cassandra.db.marshal.AbstractType

      `reverseComparator`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserType(java.lang.String keyspace, java.nio.ByteBuffer name, java.util.List<java.nio.ByteBuffer> fieldNames, java.util.List<AbstractType<?>> fieldTypes)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CQL3Type` | `asCQL3Type()`
    `boolean` | `equals(java.lang.Object o)`
    `java.nio.ByteBuffer` | `fieldName(int i)`
    `java.util.List<java.nio.ByteBuffer>` | `fieldNames()`
    `AbstractType<?>` | `fieldType(int i)`
    `java.util.List<AbstractType<?>>` | `fieldTypes()`
    `static UserType` | `getInstance(TypeParser parser)`
    `java.lang.String` | `getNameAsString()`
    `int` | `hashCode()`
    `java.lang.String` | `toString()` This must be overriden by subclasses if necessary so that for any AbstractType, this == TypeParser.parse(toString()).
    `void` | `validate(java.nio.ByteBuffer bytes)`

    - ### Methods inherited from class org.apache.cassandra.db.marshal.TupleType

      `allTypes, buildValue, compare, fromString, getSerializer, getString, isCompatibleWith, isValueCompatibleWithInternal, size, split, type`

    - ### Methods inherited from class org.apache.cassandra.db.marshal.AbstractType

      `compareCollectionMembers, componentsCount, compose, decompose, fromStringCQL2, getComponents, getString, isByteOrderComparable, isCollection, isCounter, isValueCompatibleWith, parseDefaultParameters, validateCellValue, validateCollectionMember`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### 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<java.nio.ByteBuffer> fieldNames,
                  java.util.List<AbstractType<?>> fieldTypes)

  - ### Method Detail

    - #### getInstance

          public static UserType getInstance(TypeParser parser)
                                      throws ConfigurationException,
                                             SyntaxException

      Throws:
        `ConfigurationException`
        `SyntaxException`

    - #### fieldType

          public AbstractType<?> fieldType(int i)

    - #### fieldTypes

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

    - #### fieldName

          public java.nio.ByteBuffer fieldName(int i)

    - #### fieldNames

          public java.util.List<java.nio.ByteBuffer> fieldNames()

    - #### getNameAsString

          public java.lang.String getNameAsString()

    - #### validate

          public void validate(java.nio.ByteBuffer bytes)
                        throws MarshalException

      Overrides:
        `validate` in class `TupleType`
      Throws:
        `MarshalException`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `TupleType`

    - #### equals

          public boolean equals(java.lang.Object o)

      Specified by:
        `equals` in interface `java.util.Comparator<java.nio.ByteBuffer>`
      Overrides:
        `equals` in class `TupleType`

    - #### asCQL3Type

          public CQL3Type asCQL3Type()

      Overrides:
        `asCQL3Type` 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`

Copyright © 2014 The Apache Software Foundation