Package com.remondis.propertypath.impl
Class GetImpl<I,O,E extends java.lang.Exception>
- java.lang.Object
-
- com.remondis.propertypath.impl.GetImpl<I,O,E>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> GetAndApply<I,O,X,E>andApply(java.util.function.Function<O,X> mapping)Specifies a mapping function that is applied if the getter returned a non-null value.protected static <I,X,E extends java.lang.Exception>
com.remondis.propertypath.impl.TypedTransitiveProperty<I,X,E>buildTransitiveProperty(java.lang.Class<I> startType, PropertyPath<X,I,E> selector)booleanequals(java.lang.Object obj)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.protected java.lang.Class<I>getStartType()protected com.remondis.propertypath.impl.TypedTransitiveProperty<I,O,E>getTransitiveProperty()inthashCode()java.lang.StringtoPath()java.lang.StringtoString()java.lang.StringtoString(boolean detailed)
-
-
-
Constructor Detail
-
GetImpl
public GetImpl(java.lang.Class<I> startType, PropertyPath<O,I,E> selector)
-
-
Method Detail
-
andApply
public <X> GetAndApply<I,O,X,E> andApply(java.util.function.Function<O,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.- Specified by:
andApplyin interfaceGet<I,O,E extends java.lang.Exception>- Type Parameters:
X- The new return type of the getter after applying the mapping function.- Parameters:
mapping- The mapping function - only applied if the getter has a non-null return value.- Returns:
- Returns a new object for further configuration.
-
from
public java.util.Optional<O> from(I object) throws E extends java.lang.Exception
Description copied from interface:GetEvaluates the property path on the specified object.
-
getTransitiveProperty
protected com.remondis.propertypath.impl.TypedTransitiveProperty<I,O,E> getTransitiveProperty()
- Returns:
- Returns the
TypedTransitivePropertyused to evaluate asserts.
-
getStartType
protected java.lang.Class<I> getStartType()
-
buildTransitiveProperty
protected static <I,X,E extends java.lang.Exception> com.remondis.propertypath.impl.TypedTransitiveProperty<I,X,E> buildTransitiveProperty(java.lang.Class<I> startType, PropertyPath<X,I,E> selector)
-
fromOrDefault
public O fromOrDefault(I object, O 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,E extends java.lang.Exception>- 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
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(boolean detailed)
-
-