com.openshift.internal.restclient.model.ModelNodeAdapter Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2015 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is 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:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package com.openshift.internal.restclient.model;
import java.util.Map;
import org.jboss.dmr.ModelNode;
/**
* Adapter class between what we want
* and the backing DMR json store
* @author jeff.cantrill
*
*/
public class ModelNodeAdapter {
private ModelNode node;
private Map propertyKeys;
protected ModelNodeAdapter(ModelNode node, Map propertyKeys) {
this.node = node;
this.propertyKeys = propertyKeys;
}
protected ModelNode getNode(){
return node;
}
public String toJson() {
return toJson(false);
}
public String toJson(boolean compact) {
return node.toJSONString(compact);
}
protected Map getPropertyKeys() {
return propertyKeys;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy