@NonNull @Override public String toString() { return MoreObjects.toStringHelper(this).add("Id", mTargetId) .add("actionType=",getActionType()) .add("location", getActionLocation()) .add("opType", getOperationType()).toString(); } }
/** * Check in our list of attribute actions that a particular * {@link com.android.manifmerger.Actions.ActionType} action was recorded on the passed element. * @return true if it was applied, false otherwise. */ private static boolean isAttributeOperationPresent(@NonNull XmlElement xmlElement, @NonNull Map.Entry<XmlNode.NodeName, AttributeOperationType> attributeOperation, @NonNull Actions actions, ActionType action) { for (Actions.AttributeRecord attributeRecord : actions.getAttributeRecords( xmlElement.getId(), attributeOperation.getKey())) { if (attributeRecord.getActionType() == action) { return true; } } return false; }
/** * Returns the record for an attribute creation event. The attribute is "created" when it is * added for the first time into the resulting merged xml document. */ @Nullable synchronized Actions.AttributeRecord getAttributeCreationRecord( @NonNull XmlAttribute attribute) { for (Actions.AttributeRecord attributeRecord : getAttributeRecords(attribute)) { if (attributeRecord.getActionType() == Actions.ActionType.ADDED) { return attributeRecord; } } return null; }
@Nullable private static Actions.AttributeRecord findAttributeRecord( @NonNull DecisionTreeRecord decisionTreeRecord, @NonNull XmlAttribute xmlAttribute) { for (Actions.AttributeRecord attributeRecord : decisionTreeRecord .getAttributeRecords(xmlAttribute.getName())) { if (attributeRecord.getActionType() == Actions.ActionType.ADDED) { return attributeRecord; } } return null; }