Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package gov.nist.javax.sip.header.ims;
  /*
  * 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
 *
 * .
 *
 */

Author(s):
aayush.bhatnagar Rancore Technologies Pvt Ltd, Mumbai India. This is the class used for encoding of the P-Served-User header
 
 
 
     public PServedUser(AddressImpl address)
     {
         super();
         this. = address;
     }
 
     public PServedUser()
     {
         super();
     }
 
     public String getRegistrationState() {
 
     }
 
     public String getSessionCase() {
 
         return getParameter(.);
     }
 
     public void setRegistrationState(String registrationState) {
 
         if((registrationState!=null))
         {
             if(registrationState.equals("reg")||registrationState.equals("unreg"))
             {
                 try {
                     setParameter(.registrationState);
                 } catch (ParseException e) {
                     e.printStackTrace();
                 }
 
             }
               else
               {
                   try {
                       throw new InvalidArgumentException("Value can be either reg or unreg");
                   } catch (InvalidArgumentException e) {
                          e.printStackTrace();
                     }
               }
 
         }
         else
         {
             throw new NullPointerException("regstate Parameter value is null");
         }
 
     }
 
     public void setSessionCase(String sessionCase) {
 
         if((sessionCase!=null))
         {
            if((sessionCase.equals("orig"))||(sessionCase.equals("term")))
            {
                try {
                    setParameter(.sessionCase);
                } catch (ParseException e) {
                    e.printStackTrace();
                }
            }
              else
              {
                  try {
                    throw new InvalidArgumentException("Value can be either orig or term");
                } catch (InvalidArgumentException e) {
                    e.printStackTrace();
                }
              }
        }
        else
        {
            throw new NullPointerException("sess-case Parameter value is null");
        }
    }
    @Override
    protected StringBuilder encodeBody(StringBuilder retval) {
//        StringBuilder retval = new StringBuilder();
        retval.append(.encode());
            .append(this.getRegistrationState());
            .append(this.getSessionCase());
        return retval;
    }
    public void setValue(String valuethrows ParseException {
        throw new ParseException(value,0);
    }
    public boolean equals(Object other)
    {
         if(other instanceof PServedUser)
         {
            final PServedUserHeader psu = (PServedUserHeader)other;
            return this.getAddress().equals(((PServedUserother).getAddress());
         }
        return false;
    }
    public Object clone() {
        PServedUser retval = (PServedUsersuper.clone();
        return retval;
    }
New to GrepCode? Check out our FAQ X