Class IntOrString

java.lang.Object
io.micronaut.kubernetes.client.openapi.type.IntOrString

public final class IntOrString extends Object
Custom type which is a wrapper for string or integer value.

The code has been copied from the official client and modified: IntOrString

  • Constructor Details

    • IntOrString

      public IntOrString(String value)
      Creates a string-backed value.
      Parameters:
      value - the string value
    • IntOrString

      public IntOrString(int value)
      Creates an integer-backed value.
      Parameters:
      value - the integer value
  • Method Details

    • isInteger

      public boolean isInteger()
      Whether this value wraps an integer.
      Returns:
      true if this value wraps an integer
    • getStrValue

      public String getStrValue()
      Gets the string value.
      Returns:
      the string value
      Throws:
      IllegalStateException - if this value wraps an integer
    • getIntValue

      public Integer getIntValue()
      Gets the integer value.
      Returns:
      the integer value
      Throws:
      IllegalStateException - if this value wraps a string
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object