Class ImmutableTicketContext

java.lang.Object
io.riada.insight.model.TicketContext
io.riada.insight.model.ImmutableTicketContext

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTicketContext extends TicketContext
Immutable implementation of TicketContext.

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

  • Method Details

    • currentReporter

      public Optional<InsightUser> currentReporter()
      Specified by:
      currentReporter in class TicketContext
      Returns:
      The value of the currentReporter attribute
    • currentAssignee

      public Optional<InsightUser> currentAssignee()
      Specified by:
      currentAssignee in class TicketContext
      Returns:
      The value of the currentAssignee attribute
    • currentProjectId

      public OptionalLong currentProjectId()
      Specified by:
      currentProjectId in class TicketContext
      Returns:
      The value of the currentProjectId attribute
    • withCurrentReporter

      public final ImmutableTicketContext withCurrentReporter(InsightUser value)
      Copy the current immutable object by setting a present value for the optional currentReporter attribute.
      Parameters:
      value - The value for currentReporter
      Returns:
      A modified copy of this object
    • withCurrentReporter

      public final ImmutableTicketContext withCurrentReporter(Optional<? extends InsightUser> optional)
      Copy the current immutable object by setting an optional value for the currentReporter attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for currentReporter
      Returns:
      A modified copy of this object
    • withCurrentAssignee

      public final ImmutableTicketContext withCurrentAssignee(InsightUser value)
      Copy the current immutable object by setting a present value for the optional currentAssignee attribute.
      Parameters:
      value - The value for currentAssignee
      Returns:
      A modified copy of this object
    • withCurrentAssignee

      public final ImmutableTicketContext withCurrentAssignee(Optional<? extends InsightUser> optional)
      Copy the current immutable object by setting an optional value for the currentAssignee attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for currentAssignee
      Returns:
      A modified copy of this object
    • withCurrentProjectId

      public final ImmutableTicketContext withCurrentProjectId(long value)
      Copy the current immutable object by setting a present value for the optional currentProjectId attribute.
      Parameters:
      value - The value for currentProjectId
      Returns:
      A modified copy of this object
    • withCurrentProjectId

      public final ImmutableTicketContext withCurrentProjectId(OptionalLong optional)
      Copy the current immutable object by setting an optional value for the currentProjectId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for currentProjectId
      Returns:
      A modified copy of this object
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: currentReporter, currentAssignee, currentProjectId.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableTicketContext copyOf(TicketContext instance)
      Creates an immutable copy of a TicketContext 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 TicketContext instance
    • builder

      public static ImmutableTicketContext.Builder builder()
      Creates a builder for ImmutableTicketContext.
       ImmutableTicketContext.builder()
          .setCurrentReporter(io.riada.insight.model.InsightUser) // optional currentReporter
          .setCurrentAssignee(io.riada.insight.model.InsightUser) // optional currentAssignee
          .setCurrentProjectId(long) // optional currentProjectId
          .build();
       
      Returns:
      A new ImmutableTicketContext builder