offset and length parameters can prevent alloting
* padded 0's to the digest when the input buffer is partially filled
* @param data byte array of data
@@ -46,7 +46,7 @@ public interface HashProvider {
/**
* Gets the current hash, resets any saved values from previous update()
* calls
- * @return the final hashing result of previous update() calls
+ * @return the final hashing result of previous update() calls
*/
String getValue();
}
diff --git a/src/main/java/com/alvarium/hash/HashProviderFactory.java b/src/main/java/com/alvarium/hash/HashProviderFactory.java
index 8c46f05..fe89e59 100644
--- a/src/main/java/com/alvarium/hash/HashProviderFactory.java
+++ b/src/main/java/com/alvarium/hash/HashProviderFactory.java
@@ -1,17 +1,16 @@
-
/*******************************************************************************
- * Copyright 2021 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.hash;
public class HashProviderFactory {
@@ -25,10 +24,7 @@ public HashProvider getProvider(HashType type) throws HashTypeException {
case NoHash:
return new NoneProvider();
default:
- throw new HashTypeException(String.format("type %s is not supported"
- , type));
+ throw new HashTypeException(String.format("type %s is not supported", type));
}
- }
-
+ }
}
-
diff --git a/src/main/java/com/alvarium/hash/HashType.java b/src/main/java/com/alvarium/hash/HashType.java
index f604d54..5130b4d 100644
--- a/src/main/java/com/alvarium/hash/HashType.java
+++ b/src/main/java/com/alvarium/hash/HashType.java
@@ -1,17 +1,16 @@
-
/*******************************************************************************
- * Copyright 2021 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.hash;
import com.google.gson.annotations.SerializedName;
diff --git a/src/main/java/com/alvarium/hash/HashTypeException.java b/src/main/java/com/alvarium/hash/HashTypeException.java
index 25517f7..b4bbc8d 100644
--- a/src/main/java/com/alvarium/hash/HashTypeException.java
+++ b/src/main/java/com/alvarium/hash/HashTypeException.java
@@ -1,17 +1,16 @@
-
/*******************************************************************************
- * Copyright 2021 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.hash;
public class HashTypeException extends Exception {
diff --git a/src/main/java/com/alvarium/hash/Md5Provider.java b/src/main/java/com/alvarium/hash/Md5Provider.java
index b9bf189..6e19f29 100644
--- a/src/main/java/com/alvarium/hash/Md5Provider.java
+++ b/src/main/java/com/alvarium/hash/Md5Provider.java
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright 2023 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.hash;
import java.security.MessageDigest;
@@ -18,10 +18,10 @@
import com.alvarium.utils.Encoder;
-class Md5Provider implements HashProvider{
+class Md5Provider implements HashProvider {
private final MessageDigest md5;
- protected Md5Provider() throws HashTypeException{
+ protected Md5Provider() throws HashTypeException {
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
diff --git a/src/main/java/com/alvarium/hash/NoneProvider.java b/src/main/java/com/alvarium/hash/NoneProvider.java
index 3bd945a..051a4d6 100644
--- a/src/main/java/com/alvarium/hash/NoneProvider.java
+++ b/src/main/java/com/alvarium/hash/NoneProvider.java
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright 2023 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.hash;
import java.util.Arrays;
diff --git a/src/main/java/com/alvarium/hash/Sha256Provider.java b/src/main/java/com/alvarium/hash/Sha256Provider.java
index d4531e4..b1add91 100644
--- a/src/main/java/com/alvarium/hash/Sha256Provider.java
+++ b/src/main/java/com/alvarium/hash/Sha256Provider.java
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright 2023 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.hash;
import java.security.MessageDigest;
@@ -35,7 +35,7 @@ protected Sha256Provider() throws HashTypeException {
public String derive(byte[] data) {
final byte[] hashedBytes = this.sha256.digest(data);
final String hashedString = Encoder.bytesToHex(hashedBytes);
- return hashedString;
+ return hashedString;
}
@Override
diff --git a/src/main/java/com/alvarium/serializers/AnnotationConverter.java b/src/main/java/com/alvarium/serializers/AnnotationConverter.java
index e957605..f5080d5 100644
--- a/src/main/java/com/alvarium/serializers/AnnotationConverter.java
+++ b/src/main/java/com/alvarium/serializers/AnnotationConverter.java
@@ -1,17 +1,16 @@
-
/*******************************************************************************
- * Copyright 2021 Dell Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software distributed under the License
- * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
- * or implied. See the License for the specific language governing permissions and limitations under
- * the License.
- *******************************************************************************/
+* Copyright 2024 Dell Inc.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software distributed under the License
+* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+* or implied. See the License for the specific language governing permissions and limitations under
+* the License.
+*******************************************************************************/
package com.alvarium.serializers;
import java.lang.reflect.Type;
@@ -24,14 +23,15 @@
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
-
-public class AnnotationConverter implements JsonSerializerContains the logic for deserializing stream configs depending on their types
- * + * *Any further stream implementations must have their config deserialization logic here
- * + * *This is because the StreamInfo class must be able to pass down any different type of stream * config class (e.g. IotaConfig, MqttConfig, PravegaConfig).
*/ public class StreamInfoConverter implements JsonDeserializer