001/*
002 * Copyright (c) 2007-2017 Xplenty, Inc. All Rights Reserved.
003 *
004 * Project and contact information: http://www.cascading.org/
005 *
006 * This file is part of the Cascading project.
007 *
008 * Licensed under the Apache License, Version 2.0 (the "License");
009 * you may not use this file except in compliance with the License.
010 * You may obtain a copy of the License at
011 *
012 *     http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing, software
015 * distributed under the License is distributed on an "AS IS" BASIS,
016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 * See the License for the specific language governing permissions and
018 * limitations under the License.
019 */
020
021package cascading.flow.planner;
022
023import java.util.Objects;
024
025/**
026 *
027 */
028public class PlannerInfo
029  {
030  public static final PlannerInfo NULL = new PlannerInfo( null, null, null );
031
032  public final String name;
033  public final String platform;
034  public final String registry;
035
036  public PlannerInfo( String name, String platform, String registry )
037    {
038    this.name = name;
039    this.platform = platform;
040    this.registry = registry;
041    }
042
043  @Override
044  public boolean equals( Object object )
045    {
046    if( this == object )
047      return true;
048    if( object == null || getClass() != object.getClass() )
049      return false;
050
051    PlannerInfo that = (PlannerInfo) object;
052
053    return Objects.equals( name, that.name ) &&
054      Objects.equals( platform, that.platform ) &&
055      Objects.equals( registry, that.registry );
056    }
057
058  @Override
059  public int hashCode()
060    {
061    return Objects.hash( name, platform, registry );
062    }
063
064  @Override
065  public String toString()
066    {
067    final StringBuilder sb = new StringBuilder();
068    sb.append( name ).append( ':' );
069    sb.append( platform ).append( ':' );
070    sb.append( registry );
071    return sb.toString();
072    }
073  }