blob: b289dc21416d6c911a7e12c2f927d8b598706068 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Florian Pirchner <florian.pirchner@gmail.com> - Initial implementation
*/
package org.eclipse.osbp.vaadin.addons.suggesttext.client;
import org.eclipse.osbp.vaadin.addons.suggesttext.client.OQueryDelegate.SuggestionResult;
import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
// TODO: Auto-generated Javadoc
/**
* Suggestion returned from the server.
*/
public class OSuggestion implements Suggestion {
/** The uuid. */
private final String uuid;
/** The display string. */
private final String displayString;
/**
* Instantiates a new o suggestion.
*
* @param result the result
*/
public OSuggestion(SuggestionResult result) {
this(result.uuid, result.displayText);
}
/**
* Instantiates a new o suggestion.
*
* @param uuid the uuid
* @param displayString the display string
*/
public OSuggestion(String uuid, String displayString) {
super();
this.uuid = uuid;
this.displayString = displayString;
}
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.SuggestOracle.Suggestion#getDisplayString()
*/
@Override
public String getDisplayString() {
return displayString;
}
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.SuggestOracle.Suggestion#getReplacementString()
*/
@Override
public String getReplacementString() {
return displayString;
}
/**
* An unique id which identifies the suggestion.
*
* @return the uuid
*/
public String getUuid() {
return uuid;
}
}