Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Opensec UTIL - https://nakamura5akihito.github.io/ Copyright (C) 2015 Akihito Nakamura 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 io.opensec.util.search;



A projection by a property.

Author(s):
Akihito Nakamura, AIST
 
 public class PropertyProjection
     implements Projection
 {
 //    private static final long  serialVersionUID = ;
 
 
     public static final PropertyProjection  ALL_PROJECTION =
         new PropertyProjection"*" );



    
The projection property.
 
     private String  _property;



    
Constructor.
 
     public PropertyProjection()
     {
     }



    
Constructs a PropertyProjection with the specified property.

Parameters:
property the property.
 
     public PropertyProjection(
                     final String property
                     )
     {
         setPropertyproperty );
     }



    
Sets the target property.

Parameters:
property the target property.
 
     public void setProperty(
                     final String property
                     )
     {
          = property;
     }


    
Returns the target property.

Returns:
the target property.
 
     public String getProperty()
     {
         return ;
     }
 
 
 
     //**************************************************************
     //  java.lang.Object
     //**************************************************************
 
    
Determines whether another object is equal to this PropertyProjection. The result is true if and only if the argument is not null and is an PropertyProjection object that has the same property.

Parameters:
obj the object to test for equality with this PropertyProjection.
Returns:
true if the given object equals this one; false otherwise.
    @Override
    public boolean equals(
                    final Object obj
                    )
    {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof PropertyProjection)) {
            return false;
        }
        final PropertyProjection  other = (PropertyProjection)obj;
        final String   this_p =  this.getProperty();
        final String  other_p = other.getProperty();
        if (this_p == other_p
                        ||  (this_p != null  &&  this_p.equalsother_p ))) {
                return true;
        }
        return false;
    }



    
Computes the hash code for this PropertyProjection.

Returns:
a hash code value for this object.
    @Override
    public int hashCode()
    {
        final int  prime = 37;
        int  result = 17;
        final String  p = getProperty();
        result = prime * result + (p == null ? 0 : p.hashCode());
        return result;
    }



    
Returns a string representation of this PropertyProjection. This method is intended to be used only for debugging purposes. The content and format of the returned string might not conform to any query language syntax.

Returns:
a string representation of this PropertyProjection.
    @Override
    public String toString()
    {
        return "PropertyProjection[property=" + getProperty()
            + "]";
    }
// PropertyProjection
New to GrepCode? Check out our FAQ X