com.azure.core.implementation.GeoObjectHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-core Show documentation
Show all versions of azure-core Show documentation
This package contains core types for Azure Java clients.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
package com.azure.core.implementation;
import com.azure.core.models.GeoObject;
import java.util.Map;
/**
* Helper class to access private values of {@link GeoObject} across package boundaries.
*/
public final class GeoObjectHelper {
private static GeoObjectAccessor accessor;
private GeoObjectHelper() { }
/**
* Type defining the methods to set the non-public properties of an {@link GeoObjectHelper} instance.
*/
public interface GeoObjectAccessor {
/**
* Gets the custom properties of the passed {@link GeoObject}.
*
* @param geoObject The {@link GeoObject} used to get custom properties.
* @return The custom properties of the {@link GeoObject}.
*/
Map getCustomProperties(GeoObject geoObject);
}
/**
* The method called from {@link GeoObject} to set its accessor.
*
* @param geoObjectAccessor The accessor.
*/
public static void setAccessor(final GeoObjectAccessor geoObjectAccessor) {
accessor = geoObjectAccessor;
}
/**
* Gets the custom properties of the passed {@link GeoObject}.
*
* @param geoObject The {@link GeoObject} used to get custom properties.
* @return The custom properties of the {@link GeoObject}.
*/
public static Map getCustomProperties(GeoObject geoObject) {
return accessor.getCustomProperties(geoObject);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy