2 * Copyright (c) 2018. Developed by Hedgecode.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.hedgecode.chess.domain;
19 import java.math.BigInteger;
20 import java.util.Date;
25 * @author Dmitry Samoshin aka gotty
27 public interface EtudeAdapter<TargetType> {
29 void setId(TargetType target, Long id);
30 void setHash(TargetType target, BigInteger hash);
31 void setName(TargetType target, String name);
32 void setEtudeType(TargetType target, EtudeType etudeType);
33 void setAuthor(TargetType target, Author author);
34 void setAuthorName(TargetType target, String authorName);
35 void setFen(TargetType target, String fen);
36 void setPgn(TargetType target, String pgn);
37 void setBlob(TargetType target, byte[] blob);
38 void setDate(TargetType target, Date date);
39 void setDescription(TargetType target, String description);
41 class Empty<TargetType> implements EtudeAdapter<TargetType> {
44 public void setId(TargetType target, Long id) {
48 public void setHash(TargetType target, BigInteger hash) {
52 public void setName(TargetType target, String name) {
56 public void setEtudeType(TargetType target, EtudeType etudeType) {
60 public void setAuthor(TargetType target, Author author) {
64 public void setAuthorName(TargetType target, String authorName) {
68 public void setFen(TargetType target, String fen) {
72 public void setPgn(TargetType target, String pgn) {
76 public void setBlob(TargetType target, byte[] blob) {
80 public void setDate(TargetType target, Date date) {
84 public void setDescription(TargetType target, String description) {