java.lang.Object
com.codebarrel.automation.api.component.smartvalues.objectwrappers.NumberWrapper
All Implemented Interfaces:
SmartValueWrapper

public class NumberWrapper extends Object implements SmartValueWrapper
  • Field Details

    • DEFAULT_LOCALE

      protected static final Locale DEFAULT_LOCALE
  • Constructor Details

    • NumberWrapper

      public NumberWrapper(Number value)
  • Method Details

    • abs

      public Number abs()
    • round

      public Long round()
    • asInt

      public Long asInt()
    • ceil

      public Number ceil()
    • floor

      public Number floor()
    • asPercentage

      public String asPercentage()
    • asPercentage

      public String asPercentage(String locale)
    • asCurrency

      public String asCurrency()
    • asCurrency

      public String asCurrency(String locale)
    • gt

      public Boolean gt(Object compareToObj)

      Example usage: Check for a popular issue

      {{#if(issue.Votes.gt(100))}} Popular issue {{/}}
    • gte

      public Boolean gte(Object compareToObj)

      Example usage: You could use it to compare story points to set a t-shirt size

      {{#if(issue.Story Points.gte(5))}} L {{/}}
    • eq

      public Boolean eq(Object compareToObj)

      Example usage: Check if a support ticket has only had one participants

      {{#if(issue.Request Participants.size().eq(1))}} Only one person involved {{/}}
    • lte

      public Boolean lte(Object compareToObj)

      Example usage: Check a custom fields for how many options are selected

      {{#if(issue.Multi Select custom field.size().lte(2))}} Only a few options selected {{/}}
    • lt

      public Boolean lt(Object compareToObj)

      Example usage: Check for issues with few comments

      {{#if(issue.comments.size().lt(5))}} Not many comments here {{/}}
    • plus

      public Number plus(Object modifier)

      Example usage: Automatically set your Story points to the current value and one for each subtask

      {{issue.Story Points.plus(issue.subtasks.size)}}
    • minus

      public Number minus(Object modifier)
    • multiply

      public Number multiply(Object modifier)

      Example usage: You might want to set your target date as today + 3 days for each story point

      {{issue.created.plusBusinessDays(issue.Story Points.multiply(3))}}
    • divide

      public Number divide(Object modifier)

      Example usage: Time per person spent on a ticket

      We spent {{issue.timetracking.timeSpentSeconds.divide(360).divide(issue.Request participants.size)}} hours per person on this ticket
    • format

      public String format(String format)
    • format

      public String format()
    • formatWithLocale

      public String formatWithLocale(String locale)
    • toString

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

      @Nullable public static Number getNumber(Object obj)
    • getNumber

      @Nullable public static Number getNumber(String str)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getWrappedValue

      public Object getWrappedValue()
      Specified by:
      getWrappedValue in interface SmartValueWrapper