All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.ui.DeclarativeValueProvider Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */
package com.vaadin.ui;

import java.util.IdentityHashMap;
import java.util.Map;

import com.vaadin.data.ValueProvider;

/**
 * Value provider class for declarative support.
 * 

* Provides a straightforward mapping between an item and its value. * * @param * item type */ class DeclarativeValueProvider implements ValueProvider { private final Map values = new IdentityHashMap<>(); @Override public String apply(T t) { return values.get(t); } /** * Sets a {@code value} for the item {@code t}. * * @param t * a data item * @param value * a value for the item {@code t} */ void addValue(T t, String value) { values.put(t, value); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy