Class ImmutableProto.Protoclass

Enclosing class:
ImmutableProto

@Immutable public static final class ImmutableProto.Protoclass extends Proto.Protoclass
Immutable implementation of Proto.Protoclass.

Use the builder to create immutable instances: ImmutableProto.Protoclass.builder().

  • Field Details

    • environment

      private final Proto.Environment environment
    • simpleName

      private final transient String simpleName
    • name

      private final transient String name
    • sourceElement

      private final Element sourceElement
    • packageOf

      private final Proto.DeclaringPackage packageOf
    • declaringType

      private final com.google.common.base.Optional<Proto.DeclaringType> declaringType
    • kind

      private final Proto.Protoclass.Kind kind
    • visibility

      private final transient Visibility visibility
    • element

      private final transient Element element
    • enclosingOf

      private final transient com.google.common.base.Optional<Proto.DeclaringType> enclosingOf
    • STAGE_INITIALIZING

      private static final byte STAGE_INITIALIZING
      See Also:
    • STAGE_UNINITIALIZED

      private static final byte STAGE_UNINITIALIZED
      See Also:
    • STAGE_INITIALIZED

      private static final byte STAGE_INITIALIZED
      See Also:
    • initShim

      private transient volatile ImmutableProto.Protoclass.InitShim initShim
    • lazyInitBitmap

      private transient volatile long lazyInitBitmap
    • CRITERIA_LAZY_INIT_BIT

      private static final long CRITERIA_LAZY_INIT_BIT
      See Also:
    • criteria

      private transient com.google.common.base.Optional<CriteriaMirror> criteria
    • REPOSITORY_LAZY_INIT_BIT

      private static final long REPOSITORY_LAZY_INIT_BIT
      See Also:
    • repository

      private transient com.google.common.base.Optional<RepositoryMirror> repository
    • CRITERIA_REPOSITORY_LAZY_INIT_BIT

      private static final long CRITERIA_REPOSITORY_LAZY_INIT_BIT
      See Also:
    • criteriaRepository

      private transient com.google.common.base.Optional<CriteriaRepositoryMirror> criteriaRepository
    • GSON_TYPE_ADAPTERS_LAZY_INIT_BIT

      private static final long GSON_TYPE_ADAPTERS_LAZY_INIT_BIT
      See Also:
    • gsonTypeAdapters

      private transient com.google.common.base.Optional<TypeAdaptersMirror> gsonTypeAdapters
    • TYPE_ADAPTERS_PROVIDER_LAZY_INIT_BIT

      private static final long TYPE_ADAPTERS_PROVIDER_LAZY_INIT_BIT
      See Also:
    • typeAdaptersProvider

      private transient com.google.common.base.Optional<Proto.AbstractDeclaring> typeAdaptersProvider
    • OK_JSON_TYPE_ADAPTERS_LAZY_INIT_BIT

      private static final long OK_JSON_TYPE_ADAPTERS_LAZY_INIT_BIT
      See Also:
    • okJsonTypeAdapters

      private transient com.google.common.base.Optional<OkTypeAdaptersMirror> okJsonTypeAdapters
    • OK_TYPE_ADAPTERS_PROVIDER_LAZY_INIT_BIT

      private static final long OK_TYPE_ADAPTERS_PROVIDER_LAZY_INIT_BIT
      See Also:
    • okTypeAdaptersProvider

      private transient com.google.common.base.Optional<Proto.AbstractDeclaring> okTypeAdaptersProvider
    • DATATYPE_MARKER_LAZY_INIT_BIT

      private static final long DATATYPE_MARKER_LAZY_INIT_BIT
      See Also:
    • datatypeMarker

      private transient com.google.common.base.Optional<DataMirror> datatypeMarker
    • DATATYPE_PROVIDER_LAZY_INIT_BIT

      private static final long DATATYPE_PROVIDER_LAZY_INIT_BIT
      See Also:
    • datatypeProvider

      private transient com.google.common.base.Optional<Proto.AbstractDeclaring> datatypeProvider
    • SERIAL_VERSION_LAZY_INIT_BIT

      private static final long SERIAL_VERSION_LAZY_INIT_BIT
      See Also:
    • serialVersion

      private transient com.google.common.base.Optional<Long> serialVersion
    • IS_SERIAL_STRUCTURAL_LAZY_INIT_BIT

      private static final long IS_SERIAL_STRUCTURAL_LAZY_INIT_BIT
      See Also:
    • isSerialStructural

      private transient boolean isSerialStructural
    • IS_JACKSON_SERIALIZED_LAZY_INIT_BIT

      private static final long IS_JACKSON_SERIALIZED_LAZY_INIT_BIT
      See Also:
    • isJacksonSerialized

      private transient boolean isJacksonSerialized
    • IS_JACKSON_DESERIALIZED_LAZY_INIT_BIT

      private static final long IS_JACKSON_DESERIALIZED_LAZY_INIT_BIT
      See Also:
    • isJacksonDeserialized

      private transient boolean isJacksonDeserialized
    • FEATURES_LAZY_INIT_BIT

      private static final long FEATURES_LAZY_INIT_BIT
      See Also:
    • features

      private transient ValueImmutableInfo features
    • STYLES_LAZY_INIT_BIT

      private static final long STYLES_LAZY_INIT_BIT
      See Also:
    • styles

      private transient Styles styles
    • DEPLURALIZE_LAZY_INIT_BIT

      private static final long DEPLURALIZE_LAZY_INIT_BIT
      See Also:
    • depluralize

      private transient com.google.common.base.Optional<String[]> depluralize
    • IS_JACKSON_JSON_TYPE_INFO_LAZY_INIT_BIT

      private static final long IS_JACKSON_JSON_TYPE_INFO_LAZY_INIT_BIT
      See Also:
    • isJacksonJsonTypeInfo

      private transient boolean isJacksonJsonTypeInfo
    • CONSTITUTION_LAZY_INIT_BIT

      private static final long CONSTITUTION_LAZY_INIT_BIT
      See Also:
    • constitution

      private transient Constitution constitution
    • ENCODING_INSTANTIATOR_LAZY_INIT_BIT

      private static final long ENCODING_INSTANTIATOR_LAZY_INIT_BIT
      See Also:
    • encodingInstantiator

      private transient Instantiator encodingInstantiator
  • Constructor Details

  • Method Details

    • environment

      Proto.Environment environment()
      Specified by:
      environment in class Proto.Diagnosable
      Returns:
      The value of the environment attribute
    • simpleName

      public String simpleName()
      Overrides:
      simpleName in class Proto.Diagnosable
      Returns:
      The computed-at-construction value of the simpleName attribute
    • name

      public String name()
      Overrides:
      name in class Proto.Protoclass
      Returns:
      The computed-at-construction value of the name attribute
    • sourceElement

      public Element sourceElement()
      Source type elements stores type element which is used as a source of value type model. It is the annotated class for @Value.Immutable or type referenced in @Value.Include.
      Specified by:
      sourceElement in class Proto.Protoclass
      Returns:
      source element
    • packageOf

      public Proto.DeclaringPackage packageOf()
      Declaring package that defines value type (usually by import). Or the package in which declaringType() resides.
      Specified by:
      packageOf in class Proto.Protoclass
      Returns:
      declaring package
    • declaringType

      public com.google.common.base.Optional<Proto.DeclaringType> declaringType()
      The class, which is annotated to be a @Value.Immutable, @Value.Include or @Value.Enclosing.
      Specified by:
      declaringType in class Proto.Protoclass
      Returns:
      declaring type
    • kind

      public Proto.Protoclass.Kind kind()
      Kind of protoclass declaration, it specifies how exactly the protoclass was declared.
      Specified by:
      kind in class Proto.Protoclass
      Returns:
      definition kind
    • visibility

      public Visibility visibility()
      Overrides:
      visibility in class Proto.Protoclass
      Returns:
      The computed-at-construction value of the visibility attribute
    • element

      public Element element()
      Element used mostly for error reporting, real model provided by sourceElement().
      Overrides:
      element in class Proto.Protoclass
    • enclosingOf

      public com.google.common.base.Optional<Proto.DeclaringType> enclosingOf()
      Overrides:
      enclosingOf in class Proto.Protoclass
      Returns:
      The computed-at-construction value of the enclosingOf attribute
    • withEnvironment

      public final ImmutableProto.Protoclass withEnvironment(Proto.Environment value)
      Copy the current immutable object by setting a value for the environment attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for environment
      Returns:
      A modified copy of the this object
    • withSourceElement

      public final ImmutableProto.Protoclass withSourceElement(Element value)
      Copy the current immutable object by setting a value for the sourceElement attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for sourceElement
      Returns:
      A modified copy of the this object
    • withPackageOf

      public final ImmutableProto.Protoclass withPackageOf(Proto.DeclaringPackage value)
      Copy the current immutable object by setting a value for the packageOf attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for packageOf
      Returns:
      A modified copy of the this object
    • withDeclaringType

      public final ImmutableProto.Protoclass withDeclaringType(Proto.DeclaringType value)
      Copy the current immutable object by setting a present value for the optional declaringType attribute.
      Parameters:
      value - The value for declaringType
      Returns:
      A modified copy of this object
    • withDeclaringType

      public final ImmutableProto.Protoclass withDeclaringType(com.google.common.base.Optional<? extends Proto.DeclaringType> optional)
      Copy the current immutable object by setting an optional value for the declaringType attribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for declaringType
      Returns:
      A modified copy of this object
    • withKind

      public final ImmutableProto.Protoclass withKind(Proto.Protoclass.Kind value)
      Copy the current immutable object by setting a value for the kind attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for kind
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Protoclass that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableProto.Protoclass another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: name, packageOf, declaringType, kind, visibility.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Protoclass with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • criteria

      public com.google.common.base.Optional<CriteriaMirror> criteria()

      Returns a lazily initialized value of the criteria attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      criteria in class Proto.Protoclass
      Returns:
      A lazily initialized value of the criteria attribute
    • repository

      public com.google.common.base.Optional<RepositoryMirror> repository()

      Returns a lazily initialized value of the repository attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      repository in class Proto.Protoclass
      Returns:
      A lazily initialized value of the repository attribute
    • criteriaRepository

      public com.google.common.base.Optional<CriteriaRepositoryMirror> criteriaRepository()

      Returns a lazily initialized value of the criteriaRepository attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      criteriaRepository in class Proto.Protoclass
      Returns:
      A lazily initialized value of the criteriaRepository attribute
    • gsonTypeAdapters

      public com.google.common.base.Optional<TypeAdaptersMirror> gsonTypeAdapters()

      Returns a lazily initialized value of the gsonTypeAdapters attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      gsonTypeAdapters in class Proto.Protoclass
      Returns:
      A lazily initialized value of the gsonTypeAdapters attribute
    • typeAdaptersProvider

      public com.google.common.base.Optional<Proto.AbstractDeclaring> typeAdaptersProvider()

      Returns a lazily initialized value of the typeAdaptersProvider attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      typeAdaptersProvider in class Proto.Protoclass
      Returns:
      A lazily initialized value of the typeAdaptersProvider attribute
    • okJsonTypeAdapters

      public com.google.common.base.Optional<OkTypeAdaptersMirror> okJsonTypeAdapters()

      Returns a lazily initialized value of the okJsonTypeAdapters attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      okJsonTypeAdapters in class Proto.Protoclass
      Returns:
      A lazily initialized value of the okJsonTypeAdapters attribute
    • okTypeAdaptersProvider

      public com.google.common.base.Optional<Proto.AbstractDeclaring> okTypeAdaptersProvider()

      Returns a lazily initialized value of the okTypeAdaptersProvider attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      okTypeAdaptersProvider in class Proto.Protoclass
      Returns:
      A lazily initialized value of the okTypeAdaptersProvider attribute
    • datatypeMarker

      public com.google.common.base.Optional<DataMirror> datatypeMarker()

      Returns a lazily initialized value of the datatypeMarker attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      datatypeMarker in class Proto.Protoclass
      Returns:
      A lazily initialized value of the datatypeMarker attribute
    • datatypeProvider

      public com.google.common.base.Optional<Proto.AbstractDeclaring> datatypeProvider()

      Returns a lazily initialized value of the datatypeProvider attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      datatypeProvider in class Proto.Protoclass
      Returns:
      A lazily initialized value of the datatypeProvider attribute
    • serialVersion

      public com.google.common.base.Optional<Long> serialVersion()

      Returns a lazily initialized value of the serialVersion attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      serialVersion in class Proto.Protoclass
      Returns:
      A lazily initialized value of the serialVersion attribute
    • isSerialStructural

      public boolean isSerialStructural()

      Returns a lazily initialized value of the isSerialStructural attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      isSerialStructural in class Proto.Protoclass
      Returns:
      A lazily initialized value of the isSerialStructural attribute
    • isJacksonSerialized

      public boolean isJacksonSerialized()

      Returns a lazily initialized value of the isJacksonSerialized attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      isJacksonSerialized in class Proto.Protoclass
      Returns:
      A lazily initialized value of the isJacksonSerialized attribute
    • isJacksonDeserialized

      public boolean isJacksonDeserialized()

      Returns a lazily initialized value of the isJacksonDeserialized attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      isJacksonDeserialized in class Proto.Protoclass
      Returns:
      A lazily initialized value of the isJacksonDeserialized attribute
    • features

      public ValueImmutableInfo features()

      Returns a lazily initialized value of the features attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      features in class Proto.Protoclass
      Returns:
      A lazily initialized value of the features attribute
    • styles

      public Styles styles()

      Returns a lazily initialized value of the styles attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      styles in class Proto.Protoclass
      Returns:
      A lazily initialized value of the styles attribute
    • depluralize

      public com.google.common.base.Optional<String[]> depluralize()

      Returns a lazily initialized value of the depluralize attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      depluralize in class Proto.Protoclass
      Returns:
      A lazily initialized value of the depluralize attribute
    • isJacksonJsonTypeInfo

      public boolean isJacksonJsonTypeInfo()

      Returns a lazily initialized value of the isJacksonJsonTypeInfo attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      isJacksonJsonTypeInfo in class Proto.Protoclass
      Returns:
      A lazily initialized value of the isJacksonJsonTypeInfo attribute
    • constitution

      public Constitution constitution()

      Returns a lazily initialized value of the constitution attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      constitution in class Proto.Protoclass
      Returns:
      A lazily initialized value of the constitution attribute
    • encodingInstantiator

      public Instantiator encodingInstantiator()

      Returns a lazily initialized value of the encodingInstantiator attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.

      Overrides:
      encodingInstantiator in class Proto.Protoclass
      Returns:
      A lazily initialized value of the encodingInstantiator attribute
    • copyOf

      public static ImmutableProto.Protoclass copyOf(Proto.Protoclass instance)
      Creates an immutable copy of a Proto.Protoclass value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable Protoclass instance
    • builder

      public static ImmutableProto.Protoclass.Builder builder()
      Creates a builder for Protoclass.
       ImmutableProto.Protoclass.builder()
          .environment(org.immutables.value.processor.meta.Proto.Environment) // required environment
          .sourceElement(javax.lang.model.element.Element) // required sourceElement
          .packageOf(org.immutables.value.processor.meta.Proto.DeclaringPackage) // required packageOf
          .declaringType(org.immutables.value.processor.meta.Proto.DeclaringType) // optional declaringType
          .kind(org.immutables.value.processor.meta.Proto.Protoclass.Kind) // required kind
          .build();
       
      Returns:
      A new Protoclass builder