View Javadoc

1   /*
2    * Copyright 2013 smartics, Kronseder & Reiner GmbH
3    *
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
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
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.
15   */
16  package de.smartics.properties.admin.domain.model;
17  
18  import java.io.Serializable;
19  
20  /**
21   * Provides security information to encryped and decrpted texts.
22   */
23  public final class Security implements Serializable
24  {
25    // ********************************* Fields *********************************
26  
27    // --- constants ------------------------------------------------------------
28  
29    /**
30     * The class version identifier.
31     */
32    private static final long serialVersionUID = 1L;
33  
34    // --- members --------------------------------------------------------------
35  
36    /**
37     * The encrypted text. May be <code>null</code>.
38     */
39    private final String encryptedText;
40  
41    /**
42     * The plain text. May be <code>null</code>.
43     */
44    private final String plainText;
45  
46    // ****************************** Initializer *******************************
47  
48    // ****************************** Constructors ******************************
49  
50    /**
51     * Default constructor.
52     *
53     * @param plainText the plain text.
54     * @param encryptedText the encrypted text.
55     */
56    public Security(final String plainText, final String encryptedText)
57    {
58      this.plainText = plainText;
59      this.encryptedText = encryptedText;
60    }
61  
62    // ****************************** Inner Classes *****************************
63  
64    // ********************************* Methods ********************************
65  
66    // --- init -----------------------------------------------------------------
67  
68    // --- get&set --------------------------------------------------------------
69  
70    /**
71     * Returns the encrypted text. May be <code>null</code>.
72     *
73     * @return the encrypted text.
74     */
75    public String getEncryptedText()
76    {
77      return encryptedText;
78    }
79  
80    /**
81     * Returns the plain text. May be <code>null</code>.
82     *
83     * @return the plain text.
84     */
85    public String getPlainText()
86    {
87      return plainText;
88    }
89  
90    // --- business -------------------------------------------------------------
91  
92    // --- object basics --------------------------------------------------------
93  
94  }