// Module included in the following assemblies:
//
// * operators/operator_sdk/java/osdk-java-tutorial.adoc

:_mod-docs-content-type: CONCEPT
[id="osdk-java-controller-labels-memcached_{context}"]
= Defining `labelsForMemcached`

`labelsForMemcached` is a utility to return a map of the labels to attach to the resources:

[source,java]
----
    private Map<String, String> labelsForMemcached(Memcached m) {
        Map<String, String> labels = new HashMap<>();
        labels.put("app", "memcached");
        labels.put("memcached_cr", m.getMetadata().getName());
        return labels;
    }
----