From 94fead6be729cfb23b657d853c5499709a3d27c4 Mon Sep 17 00:00:00 2001 From: Fibinger Ádám <adam.fibinger@wup.hu> Date: Mon, 11 Mar 2019 19:39:11 +0100 Subject: [PATCH] Just keeping calm and keep refactoring --- src/main/java/hu/unr/fiber/cardapi/rest/RestCard.java | 30 +++++++++++++++--------------- 1 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/hu/unr/fiber/cardapi/rest/CardEntity.java b/src/main/java/hu/unr/fiber/cardapi/rest/RestCard.java similarity index 65% rename from src/main/java/hu/unr/fiber/cardapi/rest/CardEntity.java rename to src/main/java/hu/unr/fiber/cardapi/rest/RestCard.java index 3cdefae..6c8e865 100644 --- a/src/main/java/hu/unr/fiber/cardapi/rest/CardEntity.java +++ b/src/main/java/hu/unr/fiber/cardapi/rest/RestCard.java @@ -1,11 +1,11 @@ package hu.unr.fiber.cardapi.rest; -import hu.unr.fiber.cardapi.entity.CardEntityInterface; +import hu.unr.fiber.cardapi.interfaces.CardInterface; import java.util.Objects; -public class CardEntity implements CardEntityInterface { +public class RestCard implements CardInterface { public static final long INVALID_ID = 0; private long id = INVALID_ID; @@ -14,17 +14,17 @@ private String number; private String cardHolder; - public CardEntity(long id) { + public RestCard(long id) { this.id = id; } - public CardEntity(long id, String name, String number) { + public RestCard(long id, String name, String number) { this.setId(id) .setName(name) .setNumber(number); } - public CardEntity(long id, String name, String number, String cardHolder) { + public RestCard(long id, String name, String number, String cardHolder) { this.setId(id) .setName(name) .setNumber(number) @@ -36,10 +36,10 @@ } public boolean validId() { - return (this.getId() != CardEntity.INVALID_ID); + return (this.getId() != RestCard.INVALID_ID); } - public CardEntity setId(long id) { + public RestCard setId(long id) { this.id = id; return this; } @@ -48,7 +48,7 @@ return name; } - public CardEntity setName(String name) { + public RestCard setName(String name) { this.name = name; return this; } @@ -57,7 +57,7 @@ return number; } - public CardEntity setNumber(String number) { + public RestCard setNumber(String number) { this.number = number; return this; } @@ -66,7 +66,7 @@ return cardHolder; } - public CardEntity setCardHolder(String cardHolder) { + public RestCard setCardHolder(String cardHolder) { this.cardHolder = cardHolder; return this; } @@ -74,17 +74,17 @@ public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; - CardEntity card = (CardEntity) o; + RestCard card = (RestCard) o; return id == card.id && name.equals(card.name) && number.equals(card.number) && Objects.equals(cardHolder, card.cardHolder); } - public CardEntity update(CardEntityInterface otherCardEntity) { - this.setName(otherCardEntity.getName()); - this.setNumber(otherCardEntity.getNumber()); - this.setCardHolder(otherCardEntity.getCardHolder()); + public RestCard update(CardInterface otherCard) { + this.setName(otherCard.getName()); + this.setNumber(otherCard.getNumber()); + this.setCardHolder(otherCard.getCardHolder()); return this; } -- Gitblit v1.8.0