Class Property<T>
java.lang.Object
com.sap.cloud.sdk.cloudplatform.thread.Property<T>
- Type Parameters:
T
- The generic value type.
Represents a
ThreadContext
property with a given value (or exception, if the value could not be determined).-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
decorateCallable
(Callable<?> valueGenerator) Decorate a callable, wrapping its return value into a property for convenience.decorateConfidentialCallable
(Callable<?> valueGenerator) Decorate a callable, wrapping its return value into a confidential property for convenience.boolean
io.vavr.control.Try<T>
getValue()
int
hashCode()
boolean
static <T> Property<T>
of
(T value) Creates a non-confidential property from the given value.static <T> Property<T>
ofConfidential
(T confidentialValue) Creates a confidential property from the given value.static <T> Property<T>
ofConfidentialTry
(io.vavr.control.Try<T> confidentialValueTry) Creates a confidential property from a givenTry
of a value.static <T> Property<T>
ofTry
(io.vavr.control.Try<T> valueTry) Creates a non-confidential property from a givenTry
of a value.toString()
-
Constructor Details
-
Property
Creates a property.- Parameters:
value
- ATry
that might contain the value of the property.isConfidential
- Whether the property must be handled confidentially, e.g., it should not be written to log files andtoString()
should not reveal the value or exception.
-
-
Method Details
-
of
Creates a non-confidential property from the given value.- Type Parameters:
T
- The generic value type.- Parameters:
value
- The value to create a property instance for.- Returns:
- A new property instance.
-
ofConfidential
Creates a confidential property from the given value.- Type Parameters:
T
- The generic value type.- Parameters:
confidentialValue
- The confidential value to create a confidential property instance for.- Returns:
- A new property instance.
-
ofTry
Creates a non-confidential property from a givenTry
of a value.- Type Parameters:
T
- The generic value type.- Parameters:
valueTry
- ATry
value.- Returns:
- A new property value wrapped in
Try
.
-
ofConfidentialTry
@Nonnull public static <T> Property<T> ofConfidentialTry(@Nonnull io.vavr.control.Try<T> confidentialValueTry) Creates a confidential property from a givenTry
of a value.- Type Parameters:
T
- The generic value type.- Parameters:
confidentialValueTry
- A confidentialTry
value.- Returns:
- A new confidential property value wrapped in
Try
.
-
decorateCallable
Decorate a callable, wrapping its return value into a property for convenience.- Parameters:
valueGenerator
- A producer of a property value.- Returns:
- The wrapped callable.
-
decorateConfidentialCallable
@Nonnull public static Callable<Property<?>> decorateConfidentialCallable(@Nonnull Callable<?> valueGenerator) Decorate a callable, wrapping its return value into a confidential property for convenience.- Parameters:
valueGenerator
- A producer of a confidential property value.- Returns:
- The wrapped callable.
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getValue
-
isConfidential
public boolean isConfidential()
-