/** * Return {@code true} if the given object is deprecated. */ private static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); }
/** * Return {@code true} if the given object is deprecated. */ private static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); }
/** * Returns {@code true} if the given name or identifier is deprecated. * * @see #isDeprecated() */ private static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); }
/** * Returns whether the given property is deprecated. */ static boolean isDeprecated(final AbstractIdentifiedType type) { return (type instanceof Deprecable) && ((Deprecable) type).isDeprecated(); } }
/** * Returns whether the given property is deprecated. */ static boolean isDeprecated(final AbstractIdentifiedType type) { return (type instanceof Deprecable) && ((Deprecable) type).isDeprecated(); } }
/** * Returns {@code true} if the given name or identifier is deprecated. */ private static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); }
/** * Returns {@code true} if the given name or identifier is deprecated. * * @see #isDeprecated() */ private static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); }
/** * Returns {@code true} if the given name or identifier is deprecated. */ private static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); }
/** * Returns {@code true} if the given object is deprecated. * * @param object the object to test. * @return {@code true} if the given object is deprecated. */ static boolean isDeprecated(final Object object) { return (object instanceof Deprecable) && ((Deprecable) object).isDeprecated(); } }
if (!(method instanceof Deprecable) || !((Deprecable) method).isDeprecated()) { return method;
if (!(method instanceof Deprecable) || !((Deprecable) method).isDeprecated()) { return method;
/** * Returns or create the inverse of the given operation method. If the same operation method can be used * for the inverse operation either with the exact same parameter values or with the sign of some values * reversed, then the given method is returned as-is. Otherwise a synthetic method is created. */ static OperationMethod create(final OperationMethod method) { if (method instanceof InverseOperationMethod) { return ((InverseOperationMethod) method).inverse; } if (!isInvertible(method)) { boolean useSameParameters = false; for (final GeneralParameterDescriptor descriptor : method.getParameters().descriptors()) { useSameParameters = (descriptor.getRemarks() instanceof SignReversalComment); if (!useSameParameters) break; } if (!useSameParameters) { Identifier name = method.getName(); name = new ImmutableIdentifier(null, null, "Inverse of " + name.getCode()); final Map<String,Object> properties = new HashMap<>(6); properties.put(NAME_KEY, name); properties.put(FORMULA_KEY, method.getFormula()); properties.put(REMARKS_KEY, method.getRemarks()); if (method instanceof Deprecable) { properties.put(DEPRECATED_KEY, ((Deprecable) method).isDeprecated()); } return new InverseOperationMethod(properties, method); } } return method; }
/** * Returns or create the inverse of the given operation method. If the same operation method can be used * for the inverse operation either with the exact same parameter values or with the sign of some values * reversed, then the given method is returned as-is. Otherwise a synthetic method is created. */ static OperationMethod create(final OperationMethod method) { if (method instanceof InverseOperationMethod) { return ((InverseOperationMethod) method).inverse; } if (!isInvertible(method)) { boolean useSameParameters = false; for (final GeneralParameterDescriptor descriptor : method.getParameters().descriptors()) { useSameParameters = (descriptor.getRemarks() instanceof SignReversalComment); if (!useSameParameters) break; } if (!useSameParameters) { Identifier name = method.getName(); name = new ImmutableIdentifier(null, null, "Inverse of " + name.getCode()); final Map<String,Object> properties = new HashMap<>(6); properties.put(NAME_KEY, name); properties.put(FORMULA_KEY, method.getFormula()); properties.put(REMARKS_KEY, method.getRemarks()); if (method instanceof Deprecable) { properties.put(DEPRECATED_KEY, ((Deprecable) method).isDeprecated()); } return new InverseOperationMethod(properties, method); } } return method; }
/** * Initializes this builder to the value of the given type. * The caller is responsible to invoke {@link #reset()} (if needed) before this method. */ final void initialize(final AbstractIdentifiedType template) { putIfNonNull(AbstractIdentifiedType.NAME_KEY, template.getName()); putIfNonNull(AbstractIdentifiedType.DEFINITION_KEY, template.getDefinition()); putIfNonNull(AbstractIdentifiedType.DESIGNATION_KEY, template.getDesignation()); putIfNonNull(AbstractIdentifiedType.DESCRIPTION_KEY, template.getDescription()); if (template instanceof Deprecable && ((Deprecable) template).isDeprecated()) { identification.put(AbstractIdentifiedType.DEPRECATED_KEY, Boolean.TRUE); } }
/** * Initializes this builder to the value of the given type. * The caller is responsible to invoke {@link #reset()} (if needed) before this method. */ final void initialize(final AbstractIdentifiedType template) { putIfNonNull(AbstractIdentifiedType.NAME_KEY, template.getName()); putIfNonNull(AbstractIdentifiedType.DEFINITION_KEY, template.getDefinition()); putIfNonNull(AbstractIdentifiedType.DESIGNATION_KEY, template.getDesignation()); putIfNonNull(AbstractIdentifiedType.DESCRIPTION_KEY, template.getDescription()); if (template instanceof Deprecable && ((Deprecable) template).isDeprecated()) { identification.put(AbstractIdentifiedType.DEPRECATED_KEY, Boolean.TRUE); } }
return ((Deprecable) object).isDeprecated();
/** * Constructs a new identified object with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a * user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param object the object to shallow copy. */ protected AbstractIdentifiedObject(final IdentifiedObject object) { ensureNonNull("object", object); name = object.getName(); alias = nonEmpty(object.getAlias()); // Favor null for empty set in case it is not Collections.EMPTY_SET identifiers = nonEmpty(object.getIdentifiers()); remarks = object.getRemarks(); deprecated = (object instanceof Deprecable) ? ((Deprecable) object).isDeprecated() : false; }
return ((Deprecable) object).isDeprecated();
/** * Constructs a new identified object with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a * user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param object the object to shallow copy. */ protected AbstractIdentifiedObject(final IdentifiedObject object) { ensureNonNull("object", object); name = object.getName(); alias = nonEmpty(object.getAlias()); // Favor null for empty set in case it is not Collections.EMPTY_SET identifiers = nonEmpty(object.getIdentifiers()); remarks = object.getRemarks(); deprecated = (object instanceof Deprecable) ? ((Deprecable) object).isDeprecated() : false; }
final String name = alias.tip().toString().trim(); if (ArraysExt.contains(IGNORE, name)) { assertTrue(name, ((Deprecable) alias).isDeprecated()); continue;