All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aspectran.utils.apon.Parameter Maven / Gradle / Ivy

There is a newer version: 8.1.3
Show newest version
/*
 * Copyright (c) 2008-2024 The Aspectran Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.aspectran.utils.apon;

import java.util.List;

public interface Parameter {

    /**
     * Returns the {@code Parameters} that contains the {@code Parameter}.
     * @return the {@code Parameters}
     */
    Parameters getContainer();

    /**
     * Returns the parameter name.
     * @return the parameter name
     */
    String getName();

    /**
     * Returns the fully qualified parameter name.
     * @return the qualified name
     */
    String getQualifiedName();

    /**
     * Returns the parameter value type.
     * @return the parameter value type
     */
    ValueType getValueType();

    /**
     * Sets the parameter value type.
     * @param valueType the parameter value type
     */
    void setValueType(ValueType valueType);

    /**
     * Returns whether this is a predefined parameter.
     * @return {@code true} if this is a predefined parameter, otherwise {@code false}
     */
    boolean isValueTypeFixed();

    /**
     * Returns whether the value type is hinted.
     * @return true if the value type is hinted; false otherwise
     */
    boolean isValueTypeHinted();

    /**
     * Sets whether the value type is hinted.
     * @param valueTypeHinted true if the value type is hinted; false otherwise
     */
    void setValueTypeHinted(boolean valueTypeHinted);

    /**
     * Returns whether the parameter value is an array.
     * @return {@code true} if the parameter value is an array, otherwise {@code false}
     */
    boolean isArray();

    /**
     * Returns whether the value of the array is represented using square brackets.
     * @return {@code true} if the value of the array is represented using square brackets,
     *      otherwise {@code false}
     */
    boolean isBracketed();

    /**
     * Returns whether a parameter has been assigned a value.
     * Even if a null is assigned, it is valid.
     * @return {@code true} if a parameter has been assigned a value, otherwise {@code false}
     */
    boolean isAssigned();

    /**
     * Returns whether a non-null value has been assigned.
     * @return {@code true} if a non-null value is assigned, otherwise {@code false}
     */
    boolean hasValue();

    /**
     * Returns the size of the array if the value is an array.
     * @return the size of the array
     */
    int getArraySize();

    /**
     * Returns a value as an {@code Object}.
     * @return an {@code Object}
     */
    Object getValue();

    /**
     * Change parameter type to array type.
     */
    void arraylize();

    /**
     * Puts the parameter value.
     * @param value the parameter value
     */
    void putValue(Object value);

    /**
     * Removes the parameter value.
     */
    void removeValue();

    /**
     * Returns a value as an {@code Object} array.
     * @return an array of {@code Object}
     */
    Object[] getValues();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueList();

    /**
     * Returns a value as a {@code String}.
     * @return a {@code String}
     */
    String getValueAsString();

    /**
     * Returns a value as a {@code String} array.
     * @return a {@code String} array
     */
    String[] getValueAsStringArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsStringList();

    /**
     * Returns a value as an {@code Integer}.
     * @return an {@code Integer}
     */
    Integer getValueAsInt();

    /**
     * Returns a value as an {@code Integer} array.
     * @return an {@code Integer} array
     */
    Integer[] getValueAsIntArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsIntList();

    /**
     * Returns a value as a {@code Long}.
     * @return a {@code Long}
     */
    Long getValueAsLong();

    /**
     * Returns a value as a {@code Long} array.
     * @return a {@code Long} array
     */
    Long[] getValueAsLongArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsLongList();

    /**
     * Returns a value as a {@code Float}.
     * @return a {@code Float}
     */
    Float getValueAsFloat();

    /**
     * Returns a value as a {@code Float} array.
     * @return a {@code Float} array
     */
    Float[] getValueAsFloatArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsFloatList();

    /**
     * Returns a value as a {@code Double}.
     * @return a {@code Double}
     */
    Double getValueAsDouble();

    /**
     * Returns a value as a {@code Double} array.
     * @return a {@code Double} array
     */
    Double[] getValueAsDoubleArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsDoubleList();

    /**
     * Returns a value as a {@code Boolean}.
     * @return a {@code Boolean}
     */
    Boolean getValueAsBoolean();

    /**
     * Returns a value as a {@code Boolean} array.
     * @return a {@code Boolean} array
     */
    Boolean[] getValueAsBooleanArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsBooleanList();

    /**
     * Returns a value as a {@code Parameters}.
     * @return a {@code Parameters}
     */
    Parameters getValueAsParameters();

    /**
     * Returns a value as a {@code Parameters} array.
     * @return a {@code Parameters} array
     */
    Parameters[] getValueAsParametersArray();

    /**
     * Returns a value as a {@code List}.
     * @return a {@code List}
     */
    List getValueAsParametersList();

    /**
     * Creates a new instance of {@code Parameters} with the specified
     * identifier {@code Parameter}.
     * @param  the type of the new Parameters object
     * @param identifier the specified identifier {@code Parameter}
     * @return a {@code Parameters}
     */
     T newParameters(Parameter identifier);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy