Package com.remondis.propertypath.impl
Class GetWithoutExceptionImpl<I,O>
- java.lang.Object
-
- com.remondis.propertypath.impl.GetWithoutExceptionImpl<I,O>
-
- All Implemented Interfaces:
GetWithoutException<I,O>
public class GetWithoutExceptionImpl<I,O> extends java.lang.Object implements GetWithoutException<I,O>
-
-
Method Summary
All Methods Instance Methods Concrete 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()java.lang.StringtoString(boolean detailed)
-
-
-
Method Detail
-
from
public java.util.Optional<O> from(I object)
Description copied from interface:GetWithoutExceptionEvaluates the property path on the specified object.- Specified by:
fromin interfaceGetWithoutException<I,O>- Parameters:
object- The object to evaluate the property path on.- Returns:
- Returns the value of the property wrapped in an
Optional.
-
fromOrDefault
public O fromOrDefault(I object, O defaultValue)
Description copied from interface:GetWithoutExceptionEvaluates the property path on the specified object. If a value is present it will be returned, otherwise the specified default value is returned.- Specified by:
fromOrDefaultin interfaceGetWithoutException<I,O>- 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.
-
toString
public java.lang.String toString(boolean detailed)
- Specified by:
toStringin interfaceGetWithoutException<I,O>- Returns:
- Returns a detailed string if specified, otherwise a shorter string is returned.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-