Class BuilderUtils

java.lang.Object
rs.baselib.test.BuilderUtils

public class BuilderUtils
extends java.lang.Object
Helps using the builder pattern.
Author:
ralph
  • Constructor Details

  • Method Details

    • some

      public static <T> T some​(Builder<T> builder)
      Return any object.
      Type Parameters:
      T - type of object to be built
      Parameters:
      builder - the builder to be used
      Returns:
      the object built
    • listOf

      public static <T> java.util.List<T> listOf​(int count, Builder<T> builder)
      Returns a list of objects.
      Type Parameters:
      T - type of objects to be built
      Parameters:
      count - the number of objects to create
      builder - the builder to be used
      Returns:
      the list of objects built
    • $String

      public static StringBuilder $String()
      Returns the String Builder factory.
      Returns:
      the builder for strings.
    • $Int

      public static IntBuilder $Int()
      Returns the Integer Builder factory.
      Returns:
      the builder for integers.
    • $Long

      public static LongBuilder $Long()
      Returns the Long Builder factory.
      Returns:
      the builder for long integers.
    • $RsDate

      public static RsDateBuilder $RsDate()
      Returns the RsDate Builder factory.
      Returns:
      the builder for RsDate
    • $RsDay

      public static RsDayBuilder $RsDay()
      Returns the RsDay Builder factory.
      Returns:
      the builder for RsDay
    • $RsMonth

      public static RsMonthBuilder $RsMonth()
      Returns the RsMonth Builder factory.
      Returns:
      the builder for RsMonth
    • $RsYear

      public static RsYearBuilder $RsYear()
      Returns the RsYear Builder factory.
      Returns:
      the builder for RsYear
    • $DateTimePeriod

      public static DateTimePeriodBuilder $DateTimePeriod()
      Returns the DateTimePeriod Builder factory.
      Returns:
      the builder for DateTimePeriod