Search in sources :

Example 1 with SupportedFeatureKeyCollection

use of org.apache.kafka.common.message.ApiVersionsResponseData.SupportedFeatureKeyCollection in project kafka by apache.

the class ApiVersionsResponse method createSupportedFeatureKeys.

private static SupportedFeatureKeyCollection createSupportedFeatureKeys(Features<SupportedVersionRange> latestSupportedFeatures) {
    SupportedFeatureKeyCollection converted = new SupportedFeatureKeyCollection();
    for (Map.Entry<String, SupportedVersionRange> feature : latestSupportedFeatures.features().entrySet()) {
        final SupportedFeatureKey key = new SupportedFeatureKey();
        final SupportedVersionRange versionRange = feature.getValue();
        key.setName(feature.getKey());
        key.setMinVersion(versionRange.min());
        key.setMaxVersion(versionRange.max());
        converted.add(key);
    }
    return converted;
}
Also used : SupportedVersionRange(org.apache.kafka.common.feature.SupportedVersionRange) SupportedFeatureKey(org.apache.kafka.common.message.ApiVersionsResponseData.SupportedFeatureKey) SupportedFeatureKeyCollection(org.apache.kafka.common.message.ApiVersionsResponseData.SupportedFeatureKeyCollection) Map(java.util.Map)

Aggregations

Map (java.util.Map)1 SupportedVersionRange (org.apache.kafka.common.feature.SupportedVersionRange)1 SupportedFeatureKey (org.apache.kafka.common.message.ApiVersionsResponseData.SupportedFeatureKey)1 SupportedFeatureKeyCollection (org.apache.kafka.common.message.ApiVersionsResponseData.SupportedFeatureKeyCollection)1