/******************************************************************************* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *******************************************************************************/ package org.apache.wink.common.model.synd; public class SyndCategory extends SyndCommonAttributes { private String term; private String scheme; private String label; public SyndCategory() { } public SyndCategory(String term) { setTerm(term); } public SyndCategory(String scheme, String term, String label) { setScheme(scheme); setTerm(term); setLabel(label); } public SyndCategory(SyndCategory other) { super(other); this.term = other.term; this.scheme = other.scheme; this.label = other.label; } public String getTerm() { return term; } public void setTerm(String term) { this.term = term; } public String getScheme() { return scheme; } public void setScheme(String scheme) { this.scheme = scheme; } public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } @Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((label == null) ? 0 : label.hashCode()); result = prime * result + ((scheme == null) ? 0 : scheme.hashCode()); result = prime * result + ((term == null) ? 0 : term.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (!super.equals(obj)) return false; if (getClass() != obj.getClass()) return false; SyndCategory other = (SyndCategory)obj; if (label == null) { if (other.label != null) return false; } else if (!label.equals(other.label)) return false; if (scheme == null) { if (other.scheme != null) return false; } else if (!scheme.equals(other.scheme)) return false; if (term == null) { if (other.term != null) return false; } else if (!term.equals(other.term)) return false; return true; } }