Class LocalV1License
java.lang.Object
io.confluent.kafka.schemaregistry.validator.licensing.entities.LocalV1License
Version 1 license entity that groups DeploymentScope and LicenseType together
to prevent orphaning of related license attributes during serialization.
This is a self-contained version for the validator plugin that doesn't depend on external license packages.
This entity provides: - A deterministic key for unique identification - JSON serialization for consumers - Version information for future compatibility
-
Constructor Summary
ConstructorsConstructorDescriptionLocalV1License(LicenseType licenseType, DeploymentScope deploymentScope) Creates a LocalV1License with explicit type and scope. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic LocalV1LicensefromAttributeString(String attributeString) Parses a LocalV1License from an attribute string.static LocalV1LicenseDeserializes a LocalV1License from JSON.getKey()inthashCode()Creates the attribute string in the format: "key:json" This is the format that will be stored in the license attributes.toJson()Serializes this license entity to JSON.toString()
-
Constructor Details
-
LocalV1License
Creates a LocalV1License with explicit type and scope.- Parameters:
licenseType- The license typedeploymentScope- The deployment scope
-
-
Method Details
-
getKey
- Returns:
- The unique key for this license entity
-
getLicenseType
- Returns:
- The license type
-
getDeploymentScope
- Returns:
- The deployment scope
-
toJson
Serializes this license entity to JSON.- Returns:
- JSON string representation
- Throws:
RuntimeException- if serialization fails
-
fromJson
Deserializes a LocalV1License from JSON.- Parameters:
json- The JSON string- Returns:
- The deserialized LocalV1License
- Throws:
RuntimeException- if deserialization fails
-
toAttributeString
Creates the attribute string in the format: "key:json" This is the format that will be stored in the license attributes.- Returns:
- The attribute string for serialization
-
fromAttributeString
Parses a LocalV1License from an attribute string.- Parameters:
attributeString- The attribute string in format "key:json"- Returns:
- The parsed LocalV1License
- Throws:
IllegalArgumentException- if the attribute string is invalid
-
equals
-
hashCode
-
toString
-