com.tangosol.config.expression.Parameter Maven / Gradle / Ivy
Show all versions of coherence Show documentation
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates.
*
* Licensed under the Universal Permissive License v 1.0 as shown at
* http://oss.oracle.com/licenses/upl.
*/
package com.tangosol.config.expression;
import com.tangosol.io.ExternalizableLite;
import com.tangosol.io.pof.PofReader;
import com.tangosol.io.pof.PofWriter;
import com.tangosol.io.pof.PortableObject;
import com.tangosol.util.Base;
import com.tangosol.util.ExternalizableHelper;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import javax.json.bind.annotation.JsonbProperty;
/**
* A {@link Parameter} represents an optionally named and optionally explicitly typed {@link Expression}.
*
* Terminology:
*
* A {@link Parameter} that doesn't have a name, or when the name is irrelevant, is referred to as an
* Actual {@link Parameter}. That is, only the value of the {@link Parameter} is of any importance.
*
* A {@link Parameter} with a name and/or when the name is of importance, is referred to as a Formal
* {@link Parameter} or Argument.
*
* NOTE: This class is used to represent Actual and Formal {@link Parameter}s.
*
* @author bo 2011.06.22
* @since Coherence 12.1.2
*/
public class Parameter
implements Expression, ExternalizableLite, PortableObject
{
// ----- constructors ---------------------------------------------------
/**
* Default constructor needed for serialization.
*/
public Parameter()
{
}
/**
* Construct an implicitly typed {@link Parameter} based on an {@link Expression}.
*
* @param sName the name of the {@link Parameter}
* @param expression the {@link Expression} for the {@link Parameter}
*/
public Parameter(String sName, Expression> expression)
{
m_sName = sName;
m_clzType = null;
m_expression = expression;
}
/**
* Construct an implicitly typed {@link Object}-based {@link Parameter}.
*
* @param sName the name of the {@link Parameter}
* @param oValue the value for the {@link Parameter}
*/
public Parameter(String sName, Object oValue)
{
m_sName = sName;
m_clzType = null;
m_expression = new LiteralExpression