exceptions.UserAlredyExistsException.java Source code

Java tutorial

Introduction

Here is the source code for exceptions.UserAlredyExistsException.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package exceptions;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;

/**
 *
 * @author sergio
 */
@ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "User alredy exists")
public class UserAlredyExistsException extends RuntimeException {
    private String email;
    private String username;

    public UserAlredyExistsException(String email, String username) {
        this.email = email;
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}