com.styra.opa.openapi.utils.LazySingletonValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opa Show documentation
Show all versions of opa Show documentation
SDK enabling Java developers to easily integrate with the Styra API.
The newest version!
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
package com.styra.opa.openapi.utils;
import com.fasterxml.jackson.core.type.TypeReference;
public final class LazySingletonValue {
private static final Object NOT_SET = new Object();
private final String name;
private final String json;
private final TypeReference typeReference;
private Object value = NOT_SET;
public LazySingletonValue(String name, String json, TypeReference typeReference) {
this.name = name;
this.json = json;
this.typeReference = typeReference;
}
@SuppressWarnings("unchecked")
public T value() {
if (value == NOT_SET) {
value = Utils.readDefaultOrConstValue(name, json, typeReference);
}
return (T) value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy