blob: 1b9d38944865e3ad3a88698c9bd7061a7eddbe22 [file] [log] [blame]
/*=============================================================================#
# Copyright (c) 2017, 2018 Stephan Wahlbrink and others.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
# which is available at https://www.apache.org/licenses/LICENSE-2.0.
#
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
#
# Contributors:
# Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation
#=============================================================================*/
package org.eclipse.statet.rj.eclient.core;
import static org.eclipse.statet.jcommons.lang.ObjectUtils.nonNullAssert;
import org.eclipse.statet.jcommons.lang.NonNullByDefault;
import org.eclipse.statet.ecommons.ts.core.Tool;
import org.eclipse.statet.rj.data.REnvironment;
import org.eclipse.statet.rj.data.RLanguage;
import org.eclipse.statet.rj.data.RObject;
import org.eclipse.statet.rj.data.impl.RLanguageImpl;
import org.eclipse.statet.rj.services.FQRObject;
@NonNullByDefault
public class ToolFQRObject implements FQRObject {
private final Tool tool;
private final REnvironment env;
private final RObject name;
private final RObject object;
public ToolFQRObject(final Tool tool, final REnvironment env, final RObject name, final RObject object) {
this.tool= nonNullAssert(tool);
this.env= nonNullAssert(env);
this.name= nonNullAssert(name);
this.object= nonNullAssert(object);
}
public ToolFQRObject(final Tool tool, final REnvironment env, final String name, final RObject object) {
this.tool= nonNullAssert(tool);
this.env= nonNullAssert(env);
this.name= new RLanguageImpl(RLanguage.NAME, nonNullAssert(name), null);
this.object= nonNullAssert(object);
}
@Override
public Tool getRHandle() {
return this.tool;
}
@Override
public REnvironment getEnv() {
return this.env;
}
@Override
public RObject getName() {
return this.name;
}
@Override
public RObject getObject() {
return this.object;
}
}