Class ImmutableError.Builder

  • Enclosing class:
    ImmutableError

    @NotThreadSafe
    public static final class ImmutableError.Builder
    extends Object
    Builds instances of type ImmutableError. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder for ImmutableError instances.
         new ImmutableError.Builder()
            .deviceID(String) // required deviceID
            .message(String) // required message
            .build();
         
    • Method Detail

      • from

        public final ImmutableError.Builder from​(BroadcastResult.Error instance)
        Fill a builder with attribute values from the provided Error instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • deviceID

        public final ImmutableError.Builder deviceID​(String deviceID)
        Initializes the value for the deviceID attribute.
        Parameters:
        deviceID - The value for deviceID
        Returns:
        this builder for use in a chained invocation
      • message

        public final ImmutableError.Builder message​(String message)
        Initializes the value for the message attribute.
        Parameters:
        message - The value for message
        Returns:
        this builder for use in a chained invocation