Coverage Summary for Class: DecodedPassword (com.acciente.oacc.encryptor.jasypt)

Class Method, % Line, %
DecodedPassword 100% (6/ 6) 100% (11/ 11)
DecodedPassword$Builder 100% (7/ 7) 100% (12/ 12)
total 100% (13/ 13) 100% (23/ 23)


1 /* 2  * Copyright 2009-2017, Acciente LLC 3  * 4  * Acciente LLC licenses this file to you under the 5  * Apache License, Version 2.0 (the "License"); you 6  * may not use this file except in compliance with the 7  * License. You may obtain a copy of the License at 8  * 9  * http://www.apache.org/licenses/LICENSE-2.0 10  * 11  * Unless required by applicable law or agreed to in 12  * writing, software distributed under the License is 13  * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES 14  * OR CONDITIONS OF ANY KIND, either express or implied. 15  * See the License for the specific language governing 16  * permissions and limitations under the License. 17  */ 18  19 package com.acciente.oacc.encryptor.jasypt; 20  21 class DecodedPassword { 22  private final String algorithm; 23  private final int iterations; 24  private final int saltSizeBytes; 25  private final byte[] digest; 26  27  private DecodedPassword(Builder builder) { 28  algorithm = builder.algorithm; 29  iterations = builder.iterations; 30  saltSizeBytes = builder.saltSizeBytes; 31  digest = builder.digest; 32  } 33  34  String getAlgorithm() { 35  return algorithm; 36  } 37  38  int getIterations() { 39  return iterations; 40  } 41  42  int getSaltSizeBytes() { 43  return saltSizeBytes; 44  } 45  46  byte[] getDigest() { 47  return digest; 48  } 49  50  static final class Builder { 51  private String algorithm; 52  private int iterations; 53  private int saltSizeBytes; 54  private byte[] digest; 55  56  public Builder() { 57  } 58  59  public Builder algorithm(String val) { 60  algorithm = val; 61  return this; 62  } 63  64  public Builder iterations(int val) { 65  iterations = val; 66  return this; 67  } 68  69  public Builder saltSizeBytes(int val) { 70  saltSizeBytes = val; 71  return this; 72  } 73  74  public Builder digest(byte[] val) { 75  digest = val; 76  return this; 77  } 78  79  public DecodedPassword build() { 80  return new DecodedPassword(this); 81  } 82  } 83 }