Class Option<V extends Serializable>

java.lang.Object
cn.dinodev.spring.commons.data.Option<V>
All Implemented Interfaces:
ValueLabel<V>

public class Option<V extends Serializable> extends Object implements ValueLabel<V>
Author:
Cody Lu
  • Constructor Details

    • Option

      public Option()
  • Method Details

    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl)
      从 ValueLabel 对象创建一个 Option 对象。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      Returns:
      Option 对象
    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl, Supplier<String> iconSupplier)
      从 ValueLabel 对象创建一个 Option 对象,并映射图标。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      iconSupplier - 图标提供者
      Returns:
      Option 对象
    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl, Supplier<String> iconSupplier, Supplier<String> styleSupplier)
      从 ValueLabel 对象创建一个 Option 对象,并映射图标和样式。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      iconSupplier - 图标提供者
      styleSupplier - 样式提供者
      Returns:
      Option 对象
    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl, Supplier<String> iconSupplier, Supplier<String> styleSupplier, Supplier<String> descSupplier)
      从 ValueLabel 对象创建一个 Option 对象,并映射图标、样式和描述。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      iconSupplier - 图标提供者
      styleSupplier - 样式提供者
      descSupplier - 描述提供者
      Returns:
      Option 对象
    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl, Function<V,String> iconMapper)
      从 ValueLabel 对象创建一个 Option 对象,并映射图标。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      iconMapper - 图标映射函数,传入选项value,返回图标
      Returns:
      Option 对象
    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl, Function<V,String> iconMapper, Function<V,String> styleMapper)
      从 ValueLabel 对象创建一个 Option 对象,并映射图标和样式。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      iconMapper - 图标映射函数,传入选项value,返回图标
      styleMapper - 样式映射函数,传入选项value,返回样式
      Returns:
      Option 对象
    • fromValueLabel

      public static <V extends Serializable> Option<V> fromValueLabel(ValueLabel<V> vl, Function<V,String> iconMapper, Function<V,String> styleMapper, Function<V,String> descMapper)
      从 ValueLabel 对象创建一个 Option 对象,并映射图标、样式和描述。
      Type Parameters:
      V - 选项值的类型
      Parameters:
      vl - ValueLabel 对象
      iconMapper - 图标映射函数,传入选项value,返回图标
      styleMapper - 样式映射函数,传入选项value,返回样式
      descMapper - 描述映射函数,传入选项value,返回描述
      Returns:
      Option 对象