Class Scalar

java.lang.Object
io.jenkins.plugins.casc.model.Scalar
All Implemented Interfaces:
CNode, CharSequence, Cloneable

public final class Scalar extends Object implements CNode, CharSequence
Author:
Nicolas De Loof
  • Constructor Details

    • Scalar

      public Scalar(String value, Source source)
    • Scalar

      public Scalar(String value)
    • Scalar

      public Scalar(Enum instance)
    • Scalar

      public Scalar(Boolean instance)
    • Scalar

      public Scalar(Number instance)
  • Method Details

    • getType

      public CNode.Type getType()
      Specified by:
      getType in interface CNode
    • getFormat

      public Scalar.Format getFormat()
    • isRaw

      public boolean isRaw()
    • asScalar

      public Scalar asScalar()
      Specified by:
      asScalar in interface CNode
    • getValue

      public String getValue()
      Gets value of the scalar for export.
      Returns:
      Value of the scalar if not isMasked(), SECRET_VALUE_STRING otherwise. Encrypted sensitive data will be returned as is.
    • isMasked

      public boolean isMasked()
      Check whether the scalar value should be masked in the output.
      Returns:
      true if the value is masked
      Since:
      1.25
    • sensitive

      public Scalar sensitive(boolean sensitive)
      Sets the sensitive flag. It indicates that the scalar represents a sensitive argument (secret or other restricted data).
      Parameters:
      sensitive - value to set
      Returns:
      Object instance
      Since:
      1.25
    • encrypted

      public Scalar encrypted(boolean encrypted)
      Indicates that the data is encrypted and hence safe to be exported.
      Parameters:
      encrypted - Value to set
      Returns:
      Object instance
      Since:
      1.25
    • isSensitiveData

      public boolean isSensitiveData()
      Specified by:
      isSensitiveData in interface CNode
    • toString

      @NonNull public String toString()
      Specified by:
      toString in interface CharSequence
      Overrides:
      toString in class Object
    • chars

      @NonNull public IntStream chars()
      Specified by:
      chars in interface CharSequence
    • codePoints

      @NonNull public IntStream codePoints()
      Specified by:
      codePoints in interface CharSequence
    • length

      public int length()
      Specified by:
      length in interface CharSequence
    • charAt

      public char charAt(int index)
      Specified by:
      charAt in interface CharSequence
    • subSequence

      @NonNull public CharSequence subSequence(int start, int end)
      Specified by:
      subSequence in interface CharSequence
    • getSource

      public Source getSource()
      Description copied from interface: CNode
      Indicate the source (file, line number) this specific configuration node comes from. This is used to offer relevant diagnostic messages
      Specified by:
      getSource in interface CNode
    • clone

      public CNode clone()
      Specified by:
      clone in interface CNode
      Overrides:
      clone in class Object