com.io7m.jpra.runtime.java

## Class JPRATypeModel.JPRAArray

- java.lang.Object
- - com.io7m.jpra.runtime.java.JPRATypeModelType.JPRAArrayType
  - - com.io7m.jpra.runtime.java.JPRATypeModel.JPRAArray

- All Implemented Interfaces:
    JPRATypeModelType.JPRATypeType
  Enclosing class:
    JPRATypeModel

      public static final class JPRATypeModel.JPRAArray
      extends JPRATypeModelType.JPRAArrayType

  Immutable implementation of `JPRATypeModelType.JPRAArrayType`.

  Use the static factory method to create immutable instances: `JPRATypeModel.JPRAArray.of()`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static JPRATypeModel.JPRAArray` | `copyOf(JPRATypeModelType.JPRAArrayType instance)` Creates an immutable copy of a `JPRATypeModelType.JPRAArrayType` value.
    `JPRATypeModelType.JPRATypeType` | `elementType()`
    `boolean` | `equals(Object another)` This instance is equal to all instances of `JPRAArray` that have equal attribute values.
    `int` | `hashCode()` Returns a precomputed-on-construction hash code from attributes: `length`, `elementType`.
    `int` | `length()`
    `static JPRATypeModel.JPRAArray` | `of(int length, JPRATypeModelType.JPRATypeType elementType)` Construct a new immutable `JPRAArray` instance.
    `String` | `toString()` Prints the immutable value `JPRAArray...` with all non-generated and non-auxiliary attribute values.
    `JPRATypeModel.JPRAArray` | `withElementType(JPRATypeModelType.JPRATypeType value)` Copy the current immutable object by setting a value for the `elementType` attribute.
    `JPRATypeModel.JPRAArray` | `withLength(int value)` Copy the current immutable object by setting a value for the `length` attribute.

    - ### Methods inherited from class com.io7m.jpra.runtime.java.JPRATypeModelType.JPRAArrayType

      `matchType`

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

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

- - ### Method Detail

    - #### length

          public int length()

      Returns:
        The value of the `length` attribute

    - #### elementType

          public JPRATypeModelType.JPRATypeType elementType()

      Returns:
        The value of the `elementType` attribute

    - #### withLength

          public final JPRATypeModel.JPRAArray withLength(int value)

      Copy the current immutable object by setting a value for the `length` attribute. A value equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for length
      Returns:
        A modified copy of the `this` object

    - #### withElementType

          public final JPRATypeModel.JPRAArray withElementType(JPRATypeModelType.JPRATypeType value)

      Copy the current immutable object by setting a value for the `elementType` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for elementType
      Returns:
        A modified copy of the `this` object

    - #### equals

          public boolean equals(Object another)

      This instance is equal to all instances of `JPRAArray` that have equal attribute values.
      Overrides:
        `equals` in class `Object`
      Returns:
        `true` if `this` is equal to `another` instance

    - #### hashCode

          public int hashCode()

      Returns a precomputed-on-construction hash code from attributes: `length`, `elementType`.
      Overrides:
        `hashCode` in class `Object`
      Returns:
        hashCode value

    - #### toString

          public String toString()

      Prints the immutable value `JPRAArray...` with all non-generated and non-auxiliary attribute values.
      Overrides:
        `toString` in class `Object`
      Returns:
        A string representation of the value

    - #### of

          public static JPRATypeModel.JPRAArray of(int length,
                                                   JPRATypeModelType.JPRATypeType elementType)

      Construct a new immutable `JPRAArray` instance.
      Parameters:
        `length` - The value for the `length` attribute
        `elementType` - The value for the `elementType` attribute
      Returns:
        An immutable JPRAArray instance

    - #### copyOf

          public static JPRATypeModel.JPRAArray copyOf(JPRATypeModelType.JPRAArrayType instance)

      Creates an immutable copy of a `JPRATypeModelType.JPRAArrayType` 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 JPRAArray instance

Copyright © 2015 <code@io7m.com> http://io7m.com