You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FeedEntryModel.java 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2011 gitblit.com.
  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.gitblit.models;
  17. import java.io.Serializable;
  18. import java.util.Date;
  19. import java.util.List;
  20. /**
  21. * FeedEntryModel represents an entry in a syndication (RSS) feed.
  22. *
  23. * @author James Moger
  24. */
  25. public class FeedEntryModel implements Serializable, Comparable<FeedEntryModel> {
  26. public String repository;
  27. public String branch;
  28. public String title;
  29. public String author;
  30. public Date published;
  31. public String link;
  32. public String content;
  33. public String contentType;
  34. public List<String> tags;
  35. private static final long serialVersionUID = 1L;
  36. public FeedEntryModel() {
  37. }
  38. @Override
  39. public int compareTo(FeedEntryModel o) {
  40. return o.published.compareTo(published);
  41. }
  42. @Override
  43. public int hashCode() {
  44. return link.hashCode();
  45. }
  46. @Override
  47. public boolean equals(Object o) {
  48. if (o instanceof FeedEntryModel) {
  49. return hashCode() == o.hashCode();
  50. }
  51. return false;
  52. }
  53. }