diff options
author | Tor Norbye <tnorbye@google.com> | 2014-08-20 17:01:23 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2014-08-20 17:01:23 -0700 |
commit | 1aa2e09bdbd413eacb677e9fa4b50630530d0656 (patch) | |
tree | 2f4cc6d69645bd460aa253fdecb606d764fbd25d /python/edu/learn-python/src/com/jetbrains/python/edu/course/CourseInfo.java | |
parent | 02cf98d65c798d368fcec43ed64a001d513bdd4f (diff) | |
download | idea-1aa2e09bdbd413eacb677e9fa4b50630530d0656.tar.gz |
Snapshot idea/138.1696 from git://git.jetbrains.org/idea/community.git
Change-Id: I50c97b83a815ce635e49a38380ba5b8765e4b16a
Diffstat (limited to 'python/edu/learn-python/src/com/jetbrains/python/edu/course/CourseInfo.java')
-rw-r--r-- | python/edu/learn-python/src/com/jetbrains/python/edu/course/CourseInfo.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/python/edu/learn-python/src/com/jetbrains/python/edu/course/CourseInfo.java b/python/edu/learn-python/src/com/jetbrains/python/edu/course/CourseInfo.java new file mode 100644 index 000000000000..9f820c12c572 --- /dev/null +++ b/python/edu/learn-python/src/com/jetbrains/python/edu/course/CourseInfo.java @@ -0,0 +1,52 @@ +package com.jetbrains.python.edu.course; + +/** + * Implementation of class which contains information to be shawn in course description in tool window + * and when project is being created + */ +public class CourseInfo { + private String myName; + private String myAuthor; + private String myDescription; + public static CourseInfo INVALID_COURSE = new CourseInfo("", "", ""); + + public CourseInfo(String name, String author, String description) { + myName = name; + myAuthor = author; + myDescription = description; + } + + public String getName() { + return myName; + } + + public String getAuthor() { + return myAuthor; + } + + public String getDescription() { + return myDescription; + } + + @Override + public String toString() { + return myName; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + CourseInfo that = (CourseInfo)o; + return that.getName().equals(myName) && that.getAuthor().equals(myAuthor) + && that.getDescription().equals(myDescription); + } + + @Override + public int hashCode() { + int result = myName != null ? myName.hashCode() : 0; + result = 31 * result + (myAuthor != null ? myAuthor.hashCode() : 0); + result = 31 * result + (myDescription != null ? myDescription.hashCode() : 0); + return result; + } +} |