All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rapture.common.RaptureField Maven / Gradle / Ivy

/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2011-2016 Incapture Technologies LLC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/**
 * This file is autogenerated and any changes will be overwritten.
 */

package rapture.common;

import rapture.common.*;
import rapture.object.Searchable;
import rapture.object.Storable;
import rapture.object.Debugable;
import rapture.common.version.ApiVersion;
import rapture.common.impl.jackson.JacksonUtil;
import java.util.List;
import java.util.HashSet;
import rapture.common.Scheme;
import rapture.object.Addressable;
import java.util.ArrayList;
import java.util.Set;
import rapture.common.model.IndexConfig;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* 
**/
@SuppressWarnings("all")
public class RaptureField  implements RaptureTransferObject, Debugable ,Storable , Addressable {
    /*
    *  Start of field 'authority' (String) 
    */
    private String authority;

    @JsonProperty("authority")
    public String getAuthority() {
       return authority;
    }

    @JsonProperty("authority")
    public void setAuthority(String authority) {
       this.authority =  authority ;
    }
    /*
    *  end of field 'authority' (String) 
    */


    /*
    *  Start of field 'category' (String) 
    */
    private String category;

    @JsonProperty("category")
    public String getCategory() {
       return category;
    }

    @JsonProperty("category")
    public void setCategory(String category) {
       this.category =  category ;
    }
    /*
    *  end of field 'category' (String) 
    */


    /*
    *  Start of field 'name' (String) 
    */
    private String name;

    @JsonProperty("name")
    public String getName() {
       return name;
    }

    @JsonProperty("name")
    public void setName(String name) {
       this.name =  name ;
    }
    /*
    *  end of field 'name' (String) 
    */


    /*
    *  Start of field 'longName' (String) 
    */
    private String longName;

    @JsonProperty("longName")
    public String getLongName() {
       return longName;
    }

    @JsonProperty("longName")
    public void setLongName(String longName) {
       this.longName =  longName ;
    }
    /*
    *  end of field 'longName' (String) 
    */


    /*
    *  Start of field 'description' (String) 
    */
    private String description;

    @JsonProperty("description")
    public String getDescription() {
       return description;
    }

    @JsonProperty("description")
    public void setDescription(String description) {
       this.description =  description ;
    }
    /*
    *  end of field 'description' (String) 
    */


    /*
    *  Start of field 'units' (String) 
    */
    private String units;

    @JsonProperty("units")
    public String getUnits() {
       return units;
    }

    @JsonProperty("units")
    public void setUnits(String units) {
       this.units =  units ;
    }
    /*
    *  end of field 'units' (String) 
    */


    /*
    *  Start of field 'groupingFn' (RaptureGroupingFn) 
    */
    private RaptureGroupingFn groupingFn = RaptureGroupingFn.SUM;

    @JsonProperty("groupingFn")
    public RaptureGroupingFn getGroupingFn() {
       return groupingFn;
    }

    @JsonProperty("groupingFn")
    public void setGroupingFn(RaptureGroupingFn groupingFn) {
       this.groupingFn =  groupingFn ;
    }
    /*
    *  end of field 'groupingFn' (RaptureGroupingFn) 
    */


    /*
    *  Start of field 'bands' (List) 
    */
    private List bands = new ArrayList();

    @JsonProperty("bands")
    public List getBands() {
       return bands;
    }

    @JsonProperty("bands")
    public void setBands(List bands) {
       this.bands =  bands ;
    }
    /*
    *  end of field 'bands' (List) 
    */


    /*
    *  Start of field 'fieldPaths' (Set) 
    */
    private Set fieldPaths = new HashSet();

    @JsonProperty("fieldPaths")
    public Set getFieldPaths() {
       return fieldPaths;
    }

    @JsonProperty("fieldPaths")
    public void setFieldPaths(Set fieldPaths) {
       this.fieldPaths =  fieldPaths ;
    }
    /*
    *  end of field 'fieldPaths' (Set) 
    */


   
    //@Override
    public RaptureURI getAddressURI() {
        return new RaptureURI(getStoragePath(), Scheme.FIELD);
    	// return new FIELDURI(getStoragePath());
    	
    }

    public static final Scheme scheme = Scheme.FIELD;
    //@Override
    public Scheme getScheme() {
    	return scheme;
    }	



    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((groupingFn == null) ? 0 : groupingFn.hashCode());
        result = prime * result + ((fieldPaths == null) ? 0 : fieldPaths.hashCode());
        result = prime * result + ((authority == null) ? 0 : authority.hashCode());
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        result = prime * result + ((description == null) ? 0 : description.hashCode());
        result = prime * result + ((units == null) ? 0 : units.hashCode());
        result = prime * result + ((category == null) ? 0 : category.hashCode());
        result = prime * result + ((bands == null) ? 0 : bands.hashCode());
        result = prime * result + ((longName == null) ? 0 : longName.hashCode());
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        
        RaptureField other = (RaptureField) obj;

        if (groupingFn == null) {
            if (other.groupingFn != null) {
                return false;
            }
        } else if (!groupingFn.equals(other.groupingFn)) {
            return false;
        }

        if (fieldPaths == null) {
            if (other.fieldPaths != null) {
                return false;
            }
        } else if (!fieldPaths.equals(other.fieldPaths)) {
            return false;
        }

        if (authority == null) {
            if (other.authority != null) {
                return false;
            }
        } else if (!authority.equals(other.authority)) {
            return false;
        }

        if (name == null) {
            if (other.name != null) {
                return false;
            }
        } else if (!name.equals(other.name)) {
            return false;
        }

        if (description == null) {
            if (other.description != null) {
                return false;
            }
        } else if (!description.equals(other.description)) {
            return false;
        }

        if (units == null) {
            if (other.units != null) {
                return false;
            }
        } else if (!units.equals(other.units)) {
            return false;
        }

        if (category == null) {
            if (other.category != null) {
                return false;
            }
        } else if (!category.equals(other.category)) {
            return false;
        }

        if (bands == null) {
            if (other.bands != null) {
                return false;
            }
        } else if (!bands.equals(other.bands)) {
            return false;
        }

        if (longName == null) {
            if (other.longName != null) {
                return false;
            }
        } else if (!longName.equals(other.longName)) {
            return false;
        }

           
        return true;
    }


    /**/
    public String debug() {
        StringBuilder sb = new StringBuilder();
            {
                sb.append(" groupingFn= ");
                Object o = groupingFn;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" fieldPaths= ");
                Object o = fieldPaths;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" authority= ");
                Object o = authority;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" name= ");
                Object o = name;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" description= ");
                Object o = description;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" units= ");
                Object o = units;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" category= ");
                Object o = category;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" bands= ");
                Object o = bands;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" longName= ");
                Object o = longName;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

        return sb.append("\n").toString();
    }


    @Override
    public String getStoragePath() {
     // Add key fields
      return new RaptureFieldPathBuilder()
        .authority(getAuthority())
        .name(getName())
        .buildStoragePath();
    }
    
    @Override
    public RaptureURI getStorageLocation() {
       return new RaptureFieldPathBuilder()
         .authority(getAuthority())
         .name(getName())
         .buildStorageLocation();
    }
    
    


    @Override
    public String toString() {
        return JacksonUtil.jsonFromObject(this);
    }

    private ApiVersion _raptureVersion;

    @JsonProperty("_raptureVersion")
    public ApiVersion get_raptureVersion() {
        return _raptureVersion;
    }

    @JsonProperty("_raptureVersion")
    public void set_raptureVersion(ApiVersion _raptureVersion) {
        this._raptureVersion = _raptureVersion;
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy