Class ImmutableDatatypeTypes


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    final class ImmutableDatatypeTypes
    extends Datatypes.DatatypeTypes
    Immutable implementation of Datatypes.DatatypeTypes.

    Use the builder to create immutable instances: ImmutableDatatypeTypes.builder().

    • Field Detail

      • packageGenerated

        private final java.lang.String packageGenerated
      • types

        private final com.google.common.collect.ImmutableList<ValueType> types
    • Constructor Detail

      • ImmutableDatatypeTypes

        private ImmutableDatatypeTypes​(Proto.AbstractDeclaring definedBy,
                                       java.lang.String packageGenerated,
                                       com.google.common.collect.ImmutableList<ValueType> types)
    • Method Detail

      • withDefinedBy

        public final ImmutableDatatypeTypes withDefinedBy​(Proto.AbstractDeclaring value)
        Copy the current immutable object by setting a value for the definedBy attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for definedBy
        Returns:
        A modified copy of the this object
      • withPackageGenerated

        public final ImmutableDatatypeTypes withPackageGenerated​(java.lang.String value)
        Copy the current immutable object by setting a value for the packageGenerated attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for packageGenerated
        Returns:
        A modified copy of the this object
      • withTypes

        public final ImmutableDatatypeTypes withTypes​(ValueType... elements)
        Copy the current immutable object with elements that replace the content of types.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withTypes

        public final ImmutableDatatypeTypes withTypes​(java.lang.Iterable<? extends ValueType> elements)
        Copy the current immutable object with elements that replace the content of types. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of types elements to set
        Returns:
        A modified copy of this object
      • equals

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

        public int hashCode()
        Computes a hash code from attributes: definedBy, packageGenerated, types.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableDatatypeTypes copyOf​(Datatypes.DatatypeTypes instance)
        Creates an immutable copy of a Datatypes.DatatypeTypes 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 DatatypeTypes instance
      • builder

        public static ImmutableDatatypeTypes.Builder builder()
        Creates a builder for ImmutableDatatypeTypes.
         ImmutableDatatypeTypes.builder()
            .definedBy(org.immutables.value.processor.meta.Proto.AbstractDeclaring) // required definedBy
            .packageGenerated(String) // required packageGenerated
            .addTypes|addAllTypes(org.immutables.value.processor.meta.ValueType) // types elements
            .build();
         
        Returns:
        A new ImmutableDatatypeTypes builder