Record Class TagFormat

java.lang.Object
java.lang.Record
io.github.joke.conventionalversion.config.TagFormat
Record Components:
includeComponent - release-please include-component-in-tag
separator - release-please tag-separator
includeV - release-please include-v-in-tag
All Implemented Interfaces:
Serializable

public record TagFormat(boolean includeComponent, String separator, boolean includeV) extends Record implements Serializable
How release-please renders a release tag.

Mirrors its TagName: a component, a separator and a v prefix, with the component dropped when it is excluded or empty — and the separator dropped with it, so an empty component never leaves a leading -. There is deliberately no tag prefix option here, because release-please has none; the v comes from include-v-in-tag.

See Also:
  • Constructor Details

    • TagFormat

      public TagFormat(boolean includeComponent, String separator, boolean includeV)
      Creates an instance of a TagFormat record class.
      Parameters:
      includeComponent - the value for the includeComponent record component
      separator - the value for the separator record component
      includeV - the value for the includeV record component
  • Method Details

    • defaults

      public static TagFormat defaults()
      release-please's defaults: component included, separated by -, version prefixed by v.
    • tag

      public String tag(String component, String version)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • includeComponent

      public boolean includeComponent()
      Returns the value of the includeComponent record component.
      Returns:
      the value of the includeComponent record component
    • separator

      public String separator()
      Returns the value of the separator record component.
      Returns:
      the value of the separator record component
    • includeV

      public boolean includeV()
      Returns the value of the includeV record component.
      Returns:
      the value of the includeV record component