Package com.luciad.models.features
Class FeatureChange
java.lang.Object
com.luciad.models.features.FeatureChange
Represents a change for a feature.
, 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
It indicates for a given feature, identified by its
invalid reference
FeatureId
IFeatureModel
.-
Constructor Summary
ConstructorDescriptionFeatureChange
(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 TypeMethodDescriptionboolean
Returns the changed feature, ornull
.Returns the type of change.long
Returns the id of the changed feature.int
hashCode()
-
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#getFeature
in that case. SeeFeatureModelUpdate.Builder#addFeature
for 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-
null
for 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
queried
to retrieve it. In case of aFeatureChangeType#Remove
change 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()
-