/platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/LibraryGroupElement.java

https://bitbucket.org/nbargnesi/idea · Java · 55 lines · 24 code · 11 blank · 20 comment · 4 complexity · 3c92e5f5b84e2b6eab02d501243331f7 MD5 · raw file

  1. /*
  2. * Copyright 2000-2009 JetBrains s.r.o.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.intellij.ide.projectView.impl.nodes;
  17. import com.intellij.openapi.actionSystem.DataKey;
  18. import com.intellij.openapi.module.Module;
  19. import org.jetbrains.annotations.NotNull;
  20. /**
  21. * @author Eugene Zhuravlev
  22. * Date: Sep 17, 2003
  23. * Time: 7:08:03 PM
  24. */
  25. public final class LibraryGroupElement {
  26. public static final DataKey<LibraryGroupElement[]> ARRAY_DATA_KEY = DataKey.create("libraryGroup.array");
  27. private final Module myModule;
  28. public LibraryGroupElement(@NotNull Module module) {
  29. myModule = module;
  30. }
  31. public Module getModule() {
  32. return myModule;
  33. }
  34. public boolean equals(Object o) {
  35. if (this == o) return true;
  36. if (!(o instanceof LibraryGroupElement)) return false;
  37. final LibraryGroupElement libraryGroupElement = (LibraryGroupElement)o;
  38. if (!myModule.equals(libraryGroupElement.myModule)) return false;
  39. return true;
  40. }
  41. public int hashCode() {
  42. return myModule.hashCode();
  43. }
  44. }