| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2015-2016 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.datamodel; |
| | |
| | | * when the user wants to use the value in a file. To be able to reflect |
| | | * this this object is used: it contains the binary itself, the base 64 |
| | | * representation and the file that has been used. |
| | | * |
| | | */ |
| | | public class BinaryValue |
| | | { |
| | |
| | | private File file; |
| | | private int hashCode; |
| | | |
| | | /** |
| | | * The type of the binary value. |
| | | * |
| | | */ |
| | | /** The type of the binary value. */ |
| | | public enum Type |
| | | { |
| | | /** |
| | | * The binary value is provided as Base 64 string. |
| | | */ |
| | | /** The binary value is provided as Base 64 string. */ |
| | | BASE64_STRING, |
| | | /** |
| | | * The binary value is provided as a byte array. |
| | | */ |
| | | /** The binary value is provided as a byte array. */ |
| | | BYTE_ARRAY |
| | | } |
| | | |
| | | /** |
| | | * This is done to force the use of the factory methods (createBase64 and |
| | | * createFromFile). |
| | | * |
| | | */ |
| | | /** This is done to force the use of the factory methods (createBase64 and createFromFile). */ |
| | | private BinaryValue() |
| | | { |
| | | } |
| | |
| | | return file; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean equals(Object o) |
| | | { |
| | | if (this == o) |
| | |
| | | } |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int hashCode() |
| | | { |
| | | return hashCode; |