Package com.remondis.propertypath.api
Interface GetWithoutException<I,O>
-
- Type Parameters:
I- The type to evaluate a property path on.O- The type of the property value.
- All Known Implementing Classes:
GetWithoutExceptionImpl
public interface GetWithoutException<I,O>This is aGetinterface but without exception support. The exception support can led to JDK 8 bugs when type inference for exception is to perform. To provide a workaround for this, this interface exists.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<O>from(I object)Evaluates the property path on the specified object.OfromOrDefault(I object, O defaultValue)Evaluates the property path on the specified object.java.lang.StringtoString(boolean detailed)
-
-
-
Method Detail
-
from
java.util.Optional<O> from(I object)
Evaluates the property path on the specified object.- Parameters:
object- The object to evaluate the property path on.- Returns:
- Returns the value of the property wrapped in an
Optional. - Throws:
E- May be thrown by the property path.
-
fromOrDefault
O fromOrDefault(I object, O defaultValue)
Evaluates the property path on the specified object. If a value is present it will be returned, otherwise the specified default value is returned.- Parameters:
object- The object to evaluate the property path on.defaultValue- The default value to return in case the property path does not have a value.- Returns:
- If a value is present it will be returned, otherwise the specified default value is returned.
- Throws:
E- May be thrown by the property path.
-
toString
java.lang.String toString(boolean detailed)
- Returns:
- Returns a detailed string if specified, otherwise a shorter string is returned.
-
-