Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * Conditions Of Use
  *
  * This software was developed by employees of the National Institute of
  * Standards and Technology (NIST), an agency of the Federal Government.
  * Pursuant to title 15 Untied States Code Section 105, works of NIST
  * employees are not subject to copyright protection in the United States
  * and are considered to be in the public domain.  As a result, a formal
  * license is not needed to use the software.
 *
 * This software is provided by NIST as a service and is expressly
 * provided "AS IS."  NIST MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
 * OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
 * AND DATA ACCURACY.  NIST does not warrant or make any representations
 * regarding the use of the software or the results thereof, including but
 * not limited to the correctness, accuracy, reliability or usefulness of
 * the software.
 *
 * Permission to use this software is contingent upon your acceptance
 * of the terms of this agreement
 *
 * .
 *
 */
PRODUCT OF PT INOVACAO - EST DEPARTMENT * /
 
 
 package gov.nist.javax.sip.header.ims;
 
 
 
P-Visited-Network-ID SIP Private Header: RFC 3455.

Author(s):
ALEXANDRE MIGUEL SILVA SANTOS - NĂș 10045401
 
 
 
 
 public class PVisitedNetworkID
     implements PVisitedNetworkIDHeaderSIPHeaderNamesImsExtensionHeader {

    
visited Network ID
 
     private String networkID;
 
     // issued by Miguel Freitas
     private boolean isQuoted;
 
 
     public PVisitedNetworkID() {
 
         super();
 
     }
 
     public PVisitedNetworkID(String networkID) {
 
         super();
         setVisitedNetworkID(networkID);
 
     }
 
     public PVisitedNetworkID(Token tok) {
 
         super();
         setVisitedNetworkID(tok.getTokenValue());
 
     }
 
     public StringBuilder encodeBody(StringBuilder retval) {
 
 //        StringBuilder retval = new StringBuilder();
 
         if (getVisitedNetworkID() != null)
         {
             // issued by Miguel Freitas
             if ()
                 retval.append().append(getVisitedNetworkID()).append();
             else
                 retval.append(getVisitedNetworkID());
         }
 
         if (!.isEmpty()) {
             retval.append();
             this..encode(retval);
         }
 
         return retval;
    }

    
Set the visited network ID as a string. The value will be quoted in the header.

Parameters:
networkID - string value
    public void setVisitedNetworkID(String networkID) {
        if (networkID == null)
            throw new NullPointerException(" the networkID parameter is null");
        this. = networkID;
        // issued by Miguel Freitas
        this. = true;
    }

    
Set the visited network ID as a token

Parameters:
networkID - token value
    public void setVisitedNetworkID(Token networkID) {
        if (networkID == null)
            throw new NullPointerException(" the networkID parameter is null");
        this. = networkID.getTokenValue();
        // issued by Miguel Freitas
        this. = false;
    }

    
Get the visited network ID value of this header
    public String getVisitedNetworkID() {
        return ;
    }
    public void setValue(String valuethrows ParseException {
        throw new ParseException (value,0);
    }
    public boolean equals(Object other)
    {
        if (other instanceof PVisitedNetworkIDHeader)
        {
            PVisitedNetworkIDHeader o = (PVisitedNetworkIDHeaderother;
            return (this.getVisitedNetworkID().equalso.getVisitedNetworkID() )
                && this.equalParameters( (Parameterso ));
        }
        return false;
    }
    public Object clone() {
        PVisitedNetworkID retval = (PVisitedNetworkIDsuper.clone();
        if (this. != null)
            retval.networkID = this.;
        retval.isQuoted = this.;
        return retval;
    }
New to GrepCode? Check out our FAQ X