Skip to content

Package io.github.qishr.cascara.common.service

Class CapabilityQueries

java.lang.Object
        io.github.qishr.cascara.common.service.CapabilityQueries


public class CapabilityQueries

Constructor Summary

Constructor Description
CapabilityQueries()

Method Summary

Modifier and Type Method Description
public static Predicate<ServiceMetadata> hasExactValue(String key, Object expectedValue) Matches if a property has a specific exact value (matches JSON Schema types like String, Boolean, Number)
public static Predicate<ServiceMetadata> isTrue(String key) Matches if a property is a boolean flag set to true
public static Predicate<ServiceMetadata> supportsJvmType(Class<?> jvmType) Matches if a property is a boolean flag set to true
public static java.util.function.@io.github.qishr.cascara.common.lang.annotation.Beta Predicate<ServiceMetadata> supportsContentType(ContentType contentType) Matches if a property is a boolean flag set to true
public static Predicate<ServiceMetadata> allOf(Predicate<ServiceMetadata>[] predicates) Combines multiple capability predicates using logical AND (All must match)
public static Predicate<ServiceMetadata> anyOf(Predicate<ServiceMetadata>[] predicates) Combines multiple capability predicates using logical OR (At least one must match)

Method Details

hasExactValue

public static Predicate<ServiceMetadata> hasExactValue(String key, Object expectedValue)

Matches if a property has a specific exact value (matches JSON Schema types like String, Boolean, Number)


isTrue

public static Predicate<ServiceMetadata> isTrue(String key)

Matches if a property is a boolean flag set to true


supportsJvmType

public static Predicate<ServiceMetadata> supportsJvmType(Class<?> jvmType)

Matches if a property is a boolean flag set to true


supportsContentType

@io.github.qishr.cascara.common.lang.annotation.Beta
public static java.util.function.@io.github.qishr.cascara.common.lang.annotation.Beta Predicate<ServiceMetadata> supportsContentType(ContentType contentType)

Matches if a property is a boolean flag set to true


allOf

public static Predicate<ServiceMetadata> allOf(Predicate<ServiceMetadata>[] predicates)

Combines multiple capability predicates using logical AND (All must match)

Returns:

predicate


anyOf

public static Predicate<ServiceMetadata> anyOf(Predicate<ServiceMetadata>[] predicates)

Combines multiple capability predicates using logical OR (At least one must match)