View Javadoc
1   /**
2    * Copyright (C) 2010-14 pvmanager developers. See COPYRIGHT.TXT
3    * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4    */
5   package org.epics.pvmanager;
6   
7   import java.util.Collection;
8   import java.util.Objects;
9   
10  /**
11   * Represents all the information necessary to connect to a {@link DataSource}.
12   * It represents the contact between PVManager and the {@code DataSource}.
13   *
14   * @author carcassi
15   */
16  public class ReadRecipe {
17      
18      private final Collection<ChannelReadRecipe> channelReadRecipes;
19  
20      ReadRecipe(Collection<ChannelReadRecipe> channelReadRecipes) {
21          this.channelReadRecipes = channelReadRecipes;
22      }
23  
24      /**
25       * The recipes for each channel to connect.
26       * 
27       * @return a set of channel recipes
28       */
29      public Collection<ChannelReadRecipe> getChannelReadRecipes() {
30          return channelReadRecipes;
31      }
32  
33      @Override
34      public int hashCode() {
35          int hash = 5;
36          hash = 47 * hash + Objects.hashCode(this.channelReadRecipes);
37          return hash;
38      }
39  
40      @Override
41      public boolean equals(Object obj) {
42          if (obj == null) {
43              return false;
44          }
45          if (getClass() != obj.getClass()) {
46              return false;
47          }
48          final ReadRecipe other = (ReadRecipe) obj;
49          if (!Objects.equals(this.channelReadRecipes, other.channelReadRecipes)) {
50              return false;
51          }
52          return true;
53      }
54      
55  }