/protocols/jain-megaco/megaco-api/src/main/java/javax/megaco/message/ContextInfo.java
Java | 48 lines | 33 code | 10 blank | 5 comment | 3 complexity | 4afd25548f65445aa0f499398a45543f MD5 | raw file
Possible License(s): LGPL-3.0, GPL-3.0, LGPL-2.1, GPL-2.0, CC-BY-SA-3.0, CC0-1.0, Apache-2.0, BSD-3-Clause
- package javax.megaco.message;
- import java.io.Serializable;
- /**
- * This class defines the context information block that contains the context id
- * sent in the protocol and the context level parameters.
- *
- */
- public class ContextInfo implements Serializable {
- public static final int M_CTX_NULL = 0;
- public static final int M_CTX_CHOOSE = 0xFFFFFFFE;
- public static final int M_CTX_ALL = 0xFFFFFFFF;
- private int contextId;
- private ContextParam contextParam = null;
- public ContextInfo(int contextId)
- throws IllegalArgumentException {
- if (contextId < 0) {
- IllegalArgumentException invalidArgumentException = new IllegalArgumentException(
- "ContextID for ContextInfo cannot be less than zero");
- throw invalidArgumentException;
- }
- this.contextId = contextId;
- }
- public int getContextId() {
- return this.contextId;
- }
- public ContextParam getContextParam() {
- return this.contextParam;
- }
- public void setContextParam(ContextParam contextParam)
- throws IllegalArgumentException {
- if (contextParam == null) {
- IllegalArgumentException IllegalArgumentException = new IllegalArgumentException(
- "ContextParam cannot be null for ContextInfo");
- throw IllegalArgumentException;
- }
- this.contextParam = contextParam;
- }
- }