Package cn.dinodev.spring.commons.data
Class Option<V extends Serializable>
java.lang.Object
cn.dinodev.spring.commons.data.Option<V>
- All Implemented Interfaces:
ValueLabel<V>
- Author:
- Cody Lu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl) 从 ValueLabel 对象创建一个 Option 对象。static <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl, Function<V, String> iconMapper) 从 ValueLabel 对象创建一个 Option 对象,并映射图标。static <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl, Function<V, String> iconMapper, Function<V, String> styleMapper) 从 ValueLabel 对象创建一个 Option 对象,并映射图标和样式。static <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl, Function<V, String> iconMapper, Function<V, String> styleMapper, Function<V, String> descMapper) 从 ValueLabel 对象创建一个 Option 对象,并映射图标、样式和描述。static <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl, Supplier<String> iconSupplier) 从 ValueLabel 对象创建一个 Option 对象,并映射图标。static <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl, Supplier<String> iconSupplier, Supplier<String> styleSupplier) 从 ValueLabel 对象创建一个 Option 对象,并映射图标和样式。static <V extends Serializable>
Option<V>fromValueLabel(ValueLabel<V> vl, Supplier<String> iconSupplier, Supplier<String> styleSupplier, Supplier<String> descSupplier) 从 ValueLabel 对象创建一个 Option 对象,并映射图标、样式和描述。Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cn.dinodev.spring.commons.data.ValueLabel
getLabel, getValue
-
Constructor Details
-
Option
public Option()
-
-
Method Details
-
fromValueLabel
从 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 对象
-