Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2002-2013 "Neo Technology," Network Engine for Objects in Lund AB [http://neotechnology.com] This file is part of Neo4j. Neo4j is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 package org.neo4j.server.rest.repr;
 
 import java.util.Map;
 
 
 public final class RepresentationType
 {
     private static final Map<Class<?>, Class<?>> boxed = new HashMap<Class<?>, Class<?>>();
 
     static
     {
         .putbyte.classByte.class );
         .putchar.classCharacter.class );
         .putshort.classShort.class );
         .putint.classInteger.class );
         .putlong.classLong.class );
         .putfloat.classFloat.class );
         .putdouble.classDouble.class );
         .putboolean.classBoolean.class );
     }
 
     private static final Map<StringRepresentationTypetypes = new HashMap<StringRepresentationType>();
     private static final Map<Class<?>, RepresentationTypeextended = new HashMap<Class<?>, RepresentationType>();
     // Graph database types
     public static final RepresentationType
             GRAPHDB = new RepresentationType"graphdb"nullGraphDatabaseService.class ),
             NODE = new RepresentationType"node""nodes"Node.class ),
             RELATIONSHIP = new RepresentationType"relationship""relationships"Relationship.class ),
             PATH = new RepresentationType"path""paths"Path.class ),
             FULL_PATH = new RepresentationType"full-path""full-paths"FullPath.class ),
             RELATIONSHIP_TYPE = new RepresentationType"relationship-type""relationship-types",
                     RelationshipType.class ),
             PROPERTIES = new RepresentationType"properties" ),
             INDEX = new RepresentationType"index" ),
             NODE_INDEX_ROOT = new RepresentationType"node-index" ),
             RELATIONSHIP_INDEX_ROOT = new RepresentationType"relationship-index" ),
             PLUGINS = new RepresentationType"plugins" ),
             PLUGIN = new RepresentationType"plugin" ),
             PLUGIN_DESCRIPTION = new RepresentationType"plugin-point" ),
             SERVER_PLUGIN_DESCRIPTION = new RepresentationType"server-plugin"null ),
             PLUGIN_PARAMETER = new RepresentationType"plugin-parameter""plugin-parameter-list" ),
     // Value types
     URI = new RepresentationType"uri"null ),
             TEMPLATE = new RepresentationType"uri-template" ),
             STRING = new RepresentationType"string""strings"String.class ),
     // primitives
     BYTE = new RepresentationType"byte""bytes"byte.class ),
             CHAR = new RepresentationType"character""characters"char.class ),
             SHORT = new RepresentationType"short""shorts"short.class ),
             INTEGER = new RepresentationType"integer""integers"int.class ),
             LONG = new RepresentationType"long""longs"long.class ),
             FLOAT = new RepresentationType"float""floats"float.class ),
             DOUBLE = new RepresentationType"double""doubles"double.class ),
             BOOLEAN = new RepresentationType"boolean""booleans"boolean.class ),
             NOTHING = new RepresentationType"void"null ),
     // System
     EXCEPTION = new RepresentationType"exception" ),
             MAP = new RepresentationType"map""maps"Map.class );
 
 
     final String valueName;
     final String listName;
     final Class<?> extend;
 
     private RepresentationTypeString valueNameString listName )
     {
         thisvalueNamelistNamenull );
     }
 
     private RepresentationTypeString valueNameString listNameClass<?> extend )
     {
         this. = valueName;
         this. = listName;
         this. = extend;
        if ( valueName != null )
        {
            .putvalueName.replace"-""" ), this );
        }
        if ( extend != null )
        {
            .putextendthis );
            if ( extend.isPrimitive() )
            {
                .put.getextend ), this );
            }
        }
    }
    RepresentationTypeString type )
    {
        if ( type == null )
        {
            throw new IllegalArgumentException"type may not be null" );
        }
        this. = type;
        this. = type + "s";
        this. = null;
    }
    @Override
    public String toString()
    {
        return ;
    }
    static RepresentationType valueOfClass<? extends Numbertype )
    {
        return .gettype.getSimpleName().toLowerCase() );
    }
    @Override
    public int hashCode()
    {
        if (  == null )
        {
            return .hashCode();
        }
        return .hashCode();
    }
    @Override
    public boolean equalsObject obj )
    {
        if ( obj instanceof RepresentationType )
        {
            RepresentationType that = (RepresentationTypeobj;
            if ( this. != null )
            {
                if ( .equalsthat.valueName ) )
                {
                    if ( this. != null )
                    {
                        return .equalsthat.listName );
                    }
                    else
                    {
                        return that.listName == null;
                    }
                }
            }
            else if ( this. != null )
            {
                return that.valueName == null && .equalsthat.listName );
            }
        }
        return false;
    }
    static RepresentationType extendedClass<?> extend )
    {
        return .getextend );
    }
New to GrepCode? Check out our FAQ X