@Override protected MutableList<Object> equalsFields() { return super.equalsFields().appendIfNotNull(method).appendIfNotNull(vars).appendIfNotNull(headers) .appendIfNotNull(body).appendIfNotNull(connectionTimeout).appendIfNotNull(socketTimeout); }
@Override protected MutableList<Object> equalsFields() { return super.equalsFields() .appendIfNotNull(notificationFilter).appendIfNotNull(onNotification); }
@Override protected MutableList<Object> equalsFields() { return super.equalsFields().appendIfNotNull(period); } }
@Override protected MutableList<Object> toStringOtherFields() { return super.toStringOtherFields().appendIfNotNull(description); }
@Override protected MutableList<Object> equalsFields() { return super.equalsFields().appendIfNotNull(command); }
/** returns fields which should be used for equality, including by default {@link #toStringOtherFields()} and {@link #toStringPollSource()}; * subclasses can add to the returned value */ protected MutableList<Object> equalsFields() { MutableList<Object> result = MutableList.of().appendIfNotNull(getSensor()).appendIfNotNull(toStringPollSource()); for (Object field: toStringOtherFields()) result.appendIfNotNull(field); return result; }
@Override protected MutableList<Object> equalsFields() { return super.equalsFields() .appendIfNotNull(getCommandSupplier()!=null ? getCommandSupplier().get() : null) .appendIfNotNull(getEnvSupplier()!=null ? getEnvSupplier().get() : null); }
@Override protected synchronized void onAcquired(int permits) { super.onAcquired(permits); for (int i=0; i<permits; i++) owningTasks.appendIfNotNull(Tasks.current()); }
public AbstractBrooklynObject(Map<?, ?> properties) { _legacyConstruction = !InternalFactory.FactoryConstructionTracker.isConstructing(); if (!_legacyConstruction && properties != null && !properties.isEmpty()) { log.warn("Forcing use of deprecated old-style construction for {} because properties were " + "specified ({}); instead use specs (e.g. LocationSpec, EntitySpec, etc)", getClass().getName(), properties); if (log.isDebugEnabled()) log.debug("Source of use of old-style construction", new Throwable("Source of use of old-style construction")); _legacyConstruction = true; } // inherit any context for search purposes (though maybe that should be done when creating the spec?) addSearchPath(MutableList.<String>of().appendIfNotNull(ApiObjectsFactory.get().getCatalogItemIdFromContext())); // rely on sub-class to call configure(properties), because otherwise its fields will not have been initialised }
static List<SpecParameter<?>> collectParameters(Class<?> c) { MutableList<WeightedParameter> parameters = MutableList.<WeightedParameter>of(); if (BrooklynObject.class.isAssignableFrom(c)) { @SuppressWarnings("unchecked") Class<? extends BrooklynObject> brooklynClass = (Class<? extends BrooklynObject>) c; BrooklynDynamicType<?, ?> dynamicType = BrooklynTypes.getDefinedBrooklynType(brooklynClass); BrooklynType type = dynamicType.getSnapshot(); for (ConfigKey<?> x: type.getConfigKeys()) { WeightedParameter fieldConfig = getFieldConfig(x, dynamicType.getConfigKeyField(x.getName())); parameters.appendIfNotNull(fieldConfig); } Collections.sort(parameters, new WeightedParameterComparator()); return FluentIterable.from(parameters) .transform(new SpecParameterTransformer()).toList(); } else { return ImmutableList.of(); } }
/** returns a "groupId:artifactId:version:(classifier:)packaging" string * which maven refers to as the co-ordinate */ public String getCoordinate() { return Strings.join(MutableList.<String>of().append(groupId, artifactId, packaging). appendIfNotNull(classifier).append(version), ":"); }
c1.appendIfNotNull(Strings.toString(ci));
.appendIfNotNull(inconsistentSuperTypesError) .appendAll(guesserErrors) .appendIfNotNull(beanError) .appendIfNotNull(specError); return ReferenceWithError.newInstanceThrowingError(null, Exceptions.create("Could not resolve "+typeToValidate, errors));
superTypes.appendIfNotNull(BrooklynObjectType.of(itemType).getInterfaceType());