java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.number.NumberMatch
All Implemented Interfaces:
DataExceptionContributor, JsonSerializable, RecordSerializable, XmlSerializable, Serializable

public class NumberMatch extends Bean
The result of NumberDetector.match(String): the matched text split into whole and fraction parts, plus a NumberDescriptor for it.
See Also:
  • Constructor Details

    • NumberMatch

      public NumberMatch()
  • Method Details

    • getNumberDescriptor

      public NumberDescriptor getNumberDescriptor()
    • setNumberDescriptor

      public NumberMatch setNumberDescriptor(NumberDescriptor numberDescriptor)
    • getSource

      public String getSource()
    • setSource

      public NumberMatch setSource(String source)
    • getWholePart

      public String getWholePart()
      Returns the digits before the decimal point, without the minus sign; empty if there are none.
    • setWholePart

      public NumberMatch setWholePart(String wholePart)
      Sets the digits before the decimal point, without the minus sign.
    • getFractionPart

      public String getFractionPart()
      Returns the digits after the decimal point: empty if there is no point and "0" if nothing follows it.
    • setFractionPart

      public NumberMatch setFractionPart(String fractionPart)
      Sets the digits after the decimal point.
    • isLeadingZeroWholeNumber

      public boolean isLeadingZeroWholeNumber()
      Returns true when this match is a non-negative whole number whose digits start with '0' and span more than one digit (e.g. "00", "007", "00123").

      A single "0", any negative value (e.g. "-007"), and any value with a fraction (e.g. "0.5") return false. Such leading-zero whole numbers are typically codes/identifiers and are inferred as String.

    • getNumber

      public Number getNumber()
      Parses the source text with the descriptor's field type and caches the result; returns null if there is no descriptor.
    • toString

      public String toString()
      Description copied from class: Bean
      Returns a basic JSON representation of this instance.
      Overrides:
      toString in class Bean