Subversion Repositories SmartDukaan

Rev

Rev 31860 | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.fofo;

import com.spice.profitmandi.dao.enumuration.dtr.ServiceType;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * This class basically contains payment option details
 * 
 * @author ashikali
 *
 */
@Entity
@Table(name = "fofo.payment_option")
public class PaymentOption implements Serializable {

        private static final long serialVersionUID = 1L;

        public PaymentOption() {
        }

        @Id
        @Column(name = "id")
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @Column(name = "name", unique = true)
        private String name;

        @Column(name = "sort_by", unique = true)
        private String sortBy;

        @Column(name = "active", unique = true)
        private boolean active;

        @Column(name = "service_type")
        @Enumerated(EnumType.STRING)
        private ServiceType serviceType;

        public ServiceType getServiceType() {
                return serviceType;
        }

        public void setServiceType(ServiceType serviceType) {
                this.serviceType = serviceType;
        }

        public boolean isActive() {
                return active;
        }

        public void setActive(boolean active) {
                this.active = active;
        }

        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public String getName() {
                return name;
        }

        public void setName(String name) {
                this.name = name;
        }

        public String getSortBy() {
                return sortBy;
        }

        public void setSortBy(String sortBy) {
                this.sortBy = sortBy;
        }

        @Override
        public int hashCode() {
                return Objects.hash(active, id, name, sortBy);
        }

        @Override
        public boolean equals(Object obj) {
                if (this == obj)
                        return true;
                if (obj == null)
                        return false;
                if (getClass() != obj.getClass())
                        return false;
                PaymentOption other = (PaymentOption) obj;
                return active == other.active && id == other.id && Objects.equals(name, other.name)
                                && Objects.equals(sortBy, other.sortBy);
        }


        @Override
        public String toString() {
                return "PaymentOption [id=" + id + ", name=" + name + ", sortBy=" + sortBy + ", active=" + active + ", serviceType=" + serviceType + "]";
        }
}