Package com.norconex.commons.lang.version

# Class SemanticVersionParser.SemanticVersionParserBuilder

java.lang.Object
com.norconex.commons.lang.version.SemanticVersionParser.SemanticVersionParserBuilder

Enclosing class:
  SemanticVersionParser

public static class SemanticVersionParser.SemanticVersionParserBuilder extends Object

- ## Method Summary

  Modifier and Type
  Method
  Description
  `SemanticVersionParser`
  `build()`
  `SemanticVersionParser.SemanticVersionParserBuilder`
  `clearIgnoreSuffixes()`
  `SemanticVersionParser.SemanticVersionParserBuilder`
  `ignoreLeadingCharacters(boolean ignoreLeadingCharacters)`
  Performs a best attempt to ignore any non-numeric characters before the version.
  `SemanticVersionParser.SemanticVersionParserBuilder`
  `ignoreSuffix(String ignoreSuffix)`
  `SemanticVersionParser.SemanticVersionParserBuilder`
  `ignoreSuffixes(Collection<? extends String> ignoreSuffixes)`
  `SemanticVersionParser.SemanticVersionParserBuilder`
  `optionalMinorAndPatch(boolean optionalMinorAndPatch)`
  Enables supports for version strings not having the minor or patch segment.
  `SemanticVersionParser.SemanticVersionParserBuilder`
  `optionalPreReleasePrefix(boolean optionalPreReleasePrefix)`
  Enables supports for pre-release prefix separator string to be any number of non alpha-numeric characters, including none (i.e., having the pre-release string next to version).
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### optionalMinorAndPatch

    public SemanticVersionParser.SemanticVersionParserBuilder optionalMinorAndPatch(boolean optionalMinorAndPatch)

    Enables supports for version strings not having the minor or patch segment. They are interpreted as if they were zero. Examples:

    - `1.2` is interpreted as `1.2.0`
    - `3` is interpreted as `3.0.0`
    Returns:
      `this`.

  - ### optionalPreReleasePrefix

    public SemanticVersionParser.SemanticVersionParserBuilder optionalPreReleasePrefix(boolean optionalPreReleasePrefix)

    Enables supports for pre-release prefix separator string to be any number of non alpha-numeric characters, including none (i.e., having the pre-release string next to version). Examples:

    - `1.2.3RC1` is interpreted as `1.2.3-RC1`
    - `1.2.3_M3` is interpreted as `1.2.3-M3`
    Returns:
      `this`.

  - ### ignoreLeadingCharacters

    public SemanticVersionParser.SemanticVersionParserBuilder ignoreLeadingCharacters(boolean ignoreLeadingCharacters)

    Performs a best attempt to ignore any non-numeric characters before the version. In the event that more than one valid variation of a version is be detected, the outcome is unpredictable. Examples:

    - `v1.2.3` is interpreted as `1.2.3`
    - `some-library-1.2.3` is interpreted as `1.2.3`
    Returns:
      `this`.

  - ### ignoreSuffix

    public SemanticVersionParser.SemanticVersionParserBuilder ignoreSuffix(String ignoreSuffix)

  - ### ignoreSuffixes

    public SemanticVersionParser.SemanticVersionParserBuilder ignoreSuffixes(Collection<? extends String> ignoreSuffixes)

  - ### clearIgnoreSuffixes

    public SemanticVersionParser.SemanticVersionParserBuilder clearIgnoreSuffixes()

  - ### build

    public SemanticVersionParser build()

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`