001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     matic
011 */
012package org.nuxeo.ecm.automation.client.model;
013
014import org.nuxeo.ecm.automation.client.OperationRequest;
015
016/**
017 * @author matic
018 * @deprecated in 5.7 (did not work in 5.6 either): pass Object instance directly to the
019 *             {@link OperationRequest#setInput} method.
020 */
021@Deprecated
022public class PrimitiveInput<T> implements OperationInput {
023
024    private static final long serialVersionUID = -6717232462627061723L;
025
026    public PrimitiveInput(T value) {
027        this.value = value;
028        this.type = value.getClass().getSimpleName().toLowerCase();
029    }
030
031    protected final T value;
032
033    protected final String type;
034
035    @Override
036    public boolean isBinary() {
037        return false;
038    }
039
040    @Override
041    public String getInputType() {
042        return type;
043    }
044
045    @Override
046    public String getInputRef() {
047        return String.format("%s:%s", type, value.toString());
048    }
049
050}