Class ImmutableEncodedElement.Param

    • Field Detail

      • name

        private final java.lang.String name
      • type

        private final Type type
      • annotations

        private final com.google.common.collect.ImmutableList<java.lang.String> annotations
    • Constructor Detail

      • Param

        private Param​(java.lang.String name,
                      Type type,
                      java.lang.Iterable<java.lang.String> annotations)
      • Param

        private Param​(ImmutableEncodedElement.Param original,
                      java.lang.String name,
                      Type type,
                      com.google.common.collect.ImmutableList<java.lang.String> annotations)
    • Method Detail

      • name

        java.lang.String name()
        Specified by:
        name in class EncodedElement.Param
        Returns:
        The value of the name attribute
      • annotations

        com.google.common.collect.ImmutableList<java.lang.String> annotations()
        Specified by:
        annotations in class EncodedElement.Param
        Returns:
        The value of the annotations attribute
      • withName

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

        public final ImmutableEncodedElement.Param withType​(Type value)
        Copy the current immutable object by setting a value for the type attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type
        Returns:
        A modified copy of the this object
      • withAnnotations

        public final ImmutableEncodedElement.Param withAnnotations​(java.lang.String... elements)
        Copy the current immutable object with elements that replace the content of annotations.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withAnnotations

        public final ImmutableEncodedElement.Param withAnnotations​(java.lang.Iterable<java.lang.String> elements)
        Copy the current immutable object with elements that replace the content of annotations. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of annotations 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 Param 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: name, type, annotations.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • of

        public static EncodedElement.Param of​(java.lang.String name,
                                              Type type,
                                              java.util.List<java.lang.String> annotations)
        Construct a new immutable Param instance.
        Parameters:
        name - The value for the name attribute
        type - The value for the type attribute
        annotations - The value for the annotations attribute
        Returns:
        An immutable Param instance
      • of

        public static EncodedElement.Param of​(java.lang.String name,
                                              Type type,
                                              java.lang.Iterable<java.lang.String> annotations)
        Construct a new immutable Param instance.
        Parameters:
        name - The value for the name attribute
        type - The value for the type attribute
        annotations - The value for the annotations attribute
        Returns:
        An immutable Param instance
      • copyOf

        public static EncodedElement.Param copyOf​(EncodedElement.Param instance)
        Creates an immutable copy of a EncodedElement.Param 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 Param instance