Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.uberfire.workbench.model;
 import static org.uberfire.commons.validation.PortablePreconditions.*;
 import  org.jboss.errai.common.client.api.annotations.MapsTo;
 import  org.jboss.errai.common.client.api.annotations.Portable;

Represents the position of a child panel by name. For example, within a templated perspective, panels are positioned by ErraiUI DataField names.

Positions that refer to the same field name compare equal to each other.

Instances of this class are immutable.

public class NamedPosition implements Position {

Represents the root panel of any templated perspective.
    public static final NamedPosition ROOT = new NamedPosition"" );
    private final String fieldName;

Creates a new position representing the ErraiUI @DataField with the given name. If you are trying to refer to the root of the template itself, use ROOT.

fieldName the name of the data field. Must be non-null.
    public NamedPosition( @MapsTo( "fieldName" ) String fieldName ) {
        this. = checkNotNull"fieldName"fieldName );

Returns the data field name this Position refers to.

a non-null string. For the special ROOT position constant, this is the empty string.
    public String getFieldName() {
        return ;
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + (( == null) ? 0 : .hashCode());
        return result;
    public boolean equalsObject obj ) {
        if ( this == obj )
            return true;
        if ( obj == null )
            return false;
        if ( getClass() != obj.getClass() )
            return false;
        NamedPosition other = (NamedPositionobj;
        if (  == null ) {
            if ( other.fieldName != null )
                return false;
        } else if ( !.equalsother.fieldName ) )
            return false;
        return true;
New to GrepCode? Check out our FAQ X