Package com.remondis.propertypath.impl
Class GetAndApplyImpl<I,O,T,E extends java.lang.Exception>
- java.lang.Object
-
- com.remondis.propertypath.impl.GetAndApplyImpl<I,O,T,E>
-
- All Implemented Interfaces:
Get<I,T,E>,GetAndApply<I,O,T,E>
public class GetAndApplyImpl<I,O,T,E extends java.lang.Exception> extends java.lang.Object implements GetAndApply<I,O,T,E>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> GetAndApply<I,T,X,E>andApply(java.util.function.Function<T,X> mapping)Specifies a mapping function that is applied if the getter returned a non-null value.booleanequals(java.lang.Object obj)java.util.Optional<T>from(I object)Evaluates the property path on the specified object.TfromOrDefault(I object, T defaultValue)Evaluates the property path on the specified object.inthashCode()GetWithoutException<I,T>toJdk8()java.lang.StringtoPath()java.lang.StringtoString(boolean detailed)
-
-
-
Method Detail
-
toJdk8
public GetWithoutException<I,T> toJdk8()
-
from
public java.util.Optional<T> from(I object) throws E extends java.lang.Exception
Description copied from interface:GetEvaluates the property path on the specified object.
-
fromOrDefault
public T fromOrDefault(I object, T defaultValue) throws E extends java.lang.Exception
Description copied from interface:GetEvaluates 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 interfaceGet<I,O,T>- 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.E extends java.lang.Exception
-
andApply
public <X> GetAndApply<I,T,X,E> andApply(java.util.function.Function<T,X> mapping)
Description copied from interface:GetSpecifies a mapping function that is applied if the getter returned a non-null value. The mapping function can be used for calculations or type conversions.
-
toString
public java.lang.String toString(boolean detailed)
-
toPath
public java.lang.String toPath()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-