Commit 1d68180a authored by Greg Messner's avatar Greg Messner
Browse files

Added isValid() method.

No related merge requests found
Showing with 16 additions and 0 deletions
+16 -0
...@@ -36,4 +36,8 @@ public class Branch { ...@@ -36,4 +36,8 @@ public class Branch {
public void setProtected (Boolean isProtected) { public void setProtected (Boolean isProtected) {
this.isProtected = isProtected; this.isProtected = isProtected;
} }
public static final boolean isValid (Branch branch) {
return (branch != null && branch.getName() != null);
}
} }
...@@ -107,4 +107,8 @@ public class MergeRequest { ...@@ -107,4 +107,8 @@ public class MergeRequest {
public void setUpvotes (Integer upvotes) { public void setUpvotes (Integer upvotes) {
this.upvotes = upvotes; this.upvotes = upvotes;
} }
public static final boolean isValid (MergeRequest mergeRequest) {
return (mergeRequest != null && mergeRequest.getId() != null);
}
} }
...@@ -201,4 +201,8 @@ public class Project { ...@@ -201,4 +201,8 @@ public class Project {
public void setWikiEnabled (Boolean wikiEnabled) { public void setWikiEnabled (Boolean wikiEnabled) {
this.wikiEnabled = wikiEnabled; this.wikiEnabled = wikiEnabled;
} }
public static final boolean isValid (Project project) {
return (project != null && project.getId() != null);
}
} }
...@@ -163,4 +163,8 @@ public class User { ...@@ -163,4 +163,8 @@ public class User {
public void setWebsiteUrl (String websiteUrl) { public void setWebsiteUrl (String websiteUrl) {
this.websiteUrl = websiteUrl; this.websiteUrl = websiteUrl;
} }
public static final boolean isValid (User user) {
return (user != null && user.getId() != null);
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment