Constructor and Description |
---|
SubjectHelper() |
Modifier and Type | Method and Description |
---|---|
static MultiKey |
convertToMultiKey(Subject subject)
if keeping the subjects in a map where the subject is the key, this
multikey will identify the subject
|
static boolean |
eq(Object a,
Object b) |
static boolean |
eqSource(Object a,
Object b) |
static Subject |
findInList(Collection<Subject> collection,
String sourceId,
String subjectId,
boolean exceptionIfNotFound)
see if a subject is in a list, if so return it
|
static String |
getPretty(Member _m) |
static String |
getPretty(Subject subj) |
static String |
getPrettyComplete(Subject subj) |
static int |
hashcode(Subject subject)
hashcode for subject
|
static boolean |
inList(Collection<Subject> collection,
String sourceId,
String subjectId)
see if a subject is in a list
|
static boolean |
inList(Collection<Subject> collection,
Subject subject)
see if a subject is in a list
|
static boolean |
inSourceList(Collection<Source> collection,
Source source)
see if a source is in a list
|
static Set<Source> |
nonGroupSources() |
static void |
removeDuplicates(Collection<Subject> subjects)
remove duplicates from a set
|
static void |
sortByDescription(Collection<Subject> subjects)
sort a set or list by subject description
|
static Set<Subject> |
sortSetForSearch(Collection<Subject> subjectsIn,
String searchTerm)
sort a set of subjects for a search, match id's and identifiers at top
|
static Set<Subject> |
sortSetForSearch(Collection<Subject> subjectsIn,
String searchTerm,
Set<Subject> idOrIdentifierMatches)
sort a set of subjects for a search, match id's and identifiers at top
|
static String |
sourcesToIdsString(Collection<Source> sources)
convert sources to id's comma separated
|
public static String sourcesToIdsString(Collection<Source> sources)
sources
- public static MultiKey convertToMultiKey(Subject subject)
subject
- public static void sortByDescription(Collection<Subject> subjects)
subjects
- public static Set<Subject> sortSetForSearch(Collection<Subject> subjectsIn, String searchTerm)
subjectsIn
- searchTerm
- public static Set<Subject> sortSetForSearch(Collection<Subject> subjectsIn, String searchTerm, Set<Subject> idOrIdentifierMatches)
subjectsIn
- searchTerm
- idOrIdentifierMatches
- null if not known, but if you know of some, pass that in herepublic static int hashcode(Subject subject)
subject
- public static boolean eq(Object a, Object b)
a
- b
- Subject
s and equal.
could be a multikey (sourceId, subjectId) and subjectpublic static boolean eqSource(Object a, Object b)
a
- b
- Source
s and equal.public static String getPrettyComplete(Subject subj)
subj
- public static void removeDuplicates(Collection<Subject> subjects)
subjects
- public static boolean inList(Collection<Subject> collection, Subject subject)
collection
- subject
- public static boolean inList(Collection<Subject> collection, String sourceId, String subjectId)
collection
- sourceId
- subjectId
- public static Subject findInList(Collection<Subject> collection, String sourceId, String subjectId, boolean exceptionIfNotFound)
collection
- sourceId
- subjectId
- exceptionIfNotFound
- true if an exception should be thrown if not foundpublic static boolean inSourceList(Collection<Source> collection, Source source)
collection
- source
- Copyright © 2016 Internet2. All rights reserved.