Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2006-2014 phloc systems http://www.phloc.com office[at]phloc[dot]com 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.phloc.json.impl.value;
 
 

Parameters:
<DATATYPE>
Author(s):
Boris Gregorcic
 
 public abstract class AbstractJSONPropertyValue <DATATYPE> extends AbstractJSON implements IJSONPropertyValue <DATATYPE>
 {
   private static final long serialVersionUID = -2938754463345307834L;
   private DATATYPE m_aData;
 
   protected AbstractJSONPropertyValue ()
   {
     super ();
     this. = null;// NOPMD
   }
 
   protected AbstractJSONPropertyValue (@Nonnull final DATATYPE aData)
   {
     super ();
     if (aData == null)
     {
       throw new NullPointerException ("aData"); //$NON-NLS-1$
     }
     this. = aData;
   }
 
   @Override
   @Nonnull
   public DATATYPE getData ()
   {
     if (this. == null)
     {
       throw new IllegalStateException ("getData must be overwritten!"); //$NON-NLS-1$
     }
     return this.;
   }
 
   @Override
   public final void setData (@Nonnull final DATATYPE aData)
   {
     if (aData == null)
     {
       throw new NullPointerException ("aData"); //$NON-NLS-1$
     }
     this. = aData;
   }
 
   @Override
   public boolean equals (final Object aOther)
   {
     if (aOther == this)
     {
       return true;
     }
     if (aOther == null || !getClass ().equals (aOther.getClass ()))
     {
       return false;
     }
     final AbstractJSONPropertyValue <?> rhs = (AbstractJSONPropertyValue <?>) aOther;
     return EqualsUtils.equals (this.rhs.m_aData);
   }
 
   @Override
   public int hashCode ()
   {
     return new HashCodeGenerator (this).append (this.).getHashCode ();
   }
 
   @Override
   public String toString ()
  {
    return new ToStringGenerator (this).append ("data"this.).toString (); //$NON-NLS-1$
  }
New to GrepCode? Check out our FAQ X