Class FeatureChange
It indicates for a given feature, identified by its feature id, whether it has been added, updated, etc. It can optionally contain the actual feature instance rather than only the id of the feature. The benefit of the latter is that it may avoid performing queries on the IFeatureModel.
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureChange(long featureId, FeatureChangeType featureChangeType) Constructs the feature change based on the id of the feature and the type of change for the feature.FeatureChange(Feature feature, FeatureChangeType featureChangeType) Constructs the feature change based on a feature instance and the type of change for the feature. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the changed feature, ornull.Returns the type of change.longReturns the id of the changed feature.inthashCode()
-
Constructor Details
-
FeatureChange
Constructs the feature change based on the id of the feature and the type of change for the feature.- Parameters:
featureId- the id of the feature.featureChangeType- the type of change.
-
FeatureChange
Constructs the feature change based on a feature instance and the type of change for the feature.- Parameters:
feature- the feature.featureChangeType- the type of change.
-
-
Method Details
-
getFeatureId
Returns the id of the changed feature.When this class is used as part of
FeatureModelUpdate, the feature id will not always be available. This method will throw an exception in that case. UseFeatureChange#getFeaturein that case. SeeFeatureModelUpdate.Builder#addFeaturefor more information.In all other cases, this method will not thrown an exception.
- Returns:
- the id of the changed feature. It is guaranteed to be non-
nullfor Update and Remove changes. Not necessarily for Add. - Throws:
IllegalStateException- when the feature has no id.
-
getFeature
Returns the changed feature, ornull.If no value is available, the model can be
queriedto retrieve it. In case of aFeatureChangeType#Removechange type, this method will always returnnull.- Returns:
- the changed feature, or
null.
-
getFeatureChangeType
Returns the type of change.- Returns:
- the type of change.
-
equals
-
hashCode
public int hashCode()
-