Class PrimitiveAttributeValue.PrimitiveValueConsumer<V>
Object
se.curity.identityserver.sdk.attribute.PrimitiveAttributeValue.PrimitiveValueConsumer<V>
- Enclosing class:
- PrimitiveAttributeValue
-
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveValueConsumer(@Nonnull NullableFunction<Integer, V> integerVFunction, @Nonnull NullableFunction<Long, V> longVFunction, @Nonnull NullableFunction<Float, V> floatVFunction, @Nonnull NullableFunction<Double, V> doubleVFunction, @Nonnull NullableFunction<Boolean, V> booleanVFunction, @Nonnull NullableFunction<PrimitiveAttributeValue.StringAttributeValue, V> stringVFunction) Consumer ofPrimitiveAttributeValueinstances.PrimitiveValueConsumer(@Nullable NullableFunction<Integer, V> integerVFunction, @Nullable NullableFunction<Long, V> longVFunction, @Nullable NullableFunction<Float, V> floatVFunction, @Nullable NullableFunction<Double, V> doubleVFunction, @Nullable NullableFunction<Boolean, V> booleanVFunction, @Nullable NullableFunction<PrimitiveAttributeValue.StringAttributeValue, V> stringVFunction, @Nullable NullableFunction onUnhandledType) Consumer ofPrimitiveAttributeValueinstances. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S> PrimitiveAttributeValue.PrimitiveValueConsumer<S>stringValueConsumer(NullableFunction<PrimitiveAttributeValue.StringAttributeValue, S> stringVFunction) Create aPrimitiveAttributeValue.StringAttributeValuetransformer which lets all other AttributeValue types unmodified.
-
Constructor Details
-
PrimitiveValueConsumer
public PrimitiveValueConsumer(@Nullable NullableFunction<Integer, V> integerVFunction, @Nullable NullableFunction<Long, V> longVFunction, @Nullable NullableFunction<Float, V> floatVFunction, @Nullable NullableFunction<Double, V> doubleVFunction, @Nullable NullableFunction<Boolean, V> booleanVFunction, @Nullable NullableFunction<PrimitiveAttributeValue.StringAttributeValue, V> stringVFunction, @Nullable NullableFunction onUnhandledType) Consumer ofPrimitiveAttributeValueinstances.Use this constructor if only a few primitive types need to be consumed, but not all.
All arguments may be null.
- Parameters:
integerVFunction- integer consumerlongVFunction- long consumerfloatVFunction- float consumerdoubleVFunction- double consumerbooleanVFunction- boolean consumerstringVFunction- string consumeronUnhandledType- handler for cases where a handler for the type of the primitive value is not provided. If null, a handler which always throwsRuntimeExceptionis used.
-
PrimitiveValueConsumer
public PrimitiveValueConsumer(@Nonnull NullableFunction<Integer, V> integerVFunction, @Nonnull NullableFunction<Long, V> longVFunction, @Nonnull NullableFunction<Float, V> floatVFunction, @Nonnull NullableFunction<Double, V> doubleVFunction, @Nonnull NullableFunction<Boolean, V> booleanVFunction, @Nonnull NullableFunction<PrimitiveAttributeValue.StringAttributeValue, V> stringVFunction) Consumer ofPrimitiveAttributeValueinstances.Use this constructor if all of the primitive types should be consumed. Notice that if all arguments are given, it is guaranteed at compile time that all primitive types are handled.
- Parameters:
integerVFunction- integer consumerlongVFunction- long consumerfloatVFunction- float consumerdoubleVFunction- double consumerbooleanVFunction- boolean consumerstringVFunction- string consumer- Throws:
NullPointerException- if any argument is null
-
-
Method Details
-
stringValueConsumer
public static <S> PrimitiveAttributeValue.PrimitiveValueConsumer<S> stringValueConsumer(NullableFunction<PrimitiveAttributeValue.StringAttributeValue, S> stringVFunction) Create aPrimitiveAttributeValue.StringAttributeValuetransformer which lets all other AttributeValue types unmodified.- Type Parameters:
S- Type of AttributeValue returned by the transformer- Parameters:
stringVFunction- string attribute value transformer- Returns:
- a
PrimitiveAttributeValue.PrimitiveValueConsumerwhich transforms only String values.
-