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

com.futuresight.util.mystique.MystiqueMystTurn Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
/*
 * Copyright (c) Balajee TM 2016.
 * All rights reserved.
 * License -  @see 
 */

/*
 * Created on 25 Aug, 2016 by balajeetm
 */
package com.futuresight.util.mystique;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.futuresight.util.mystique.lever.MysCon;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;

/**
 * The Class MystiqueMystTurn.
 *
 * @author balajeetm
 */
@Component
public class MystiqueMystTurn extends AbstractMystTurn {

	/** The json genie. */
	@Autowired
	private JsonMystique jsonMystique;

	/* (non-Javadoc)
	 * @see com.futuresight.util.mystique.Mystique#transform(java.util.List, com.google.gson.JsonObject, java.lang.String)
	 */
	@Override
	public JsonElement transmute(List source, JsonObject deps, JsonObject aces, JsonObject turn) {
		JsonElement transform = null;
		JsonElement elementSource = jsonLever.getFirst(source);
		if (null != elementSource) {
			turn = jsonLever.getAsJsonObject(turn, new JsonObject());
			String value = jsonLever.getAsString(turn.get(MysCon.VALUE));
			if (null != value) {
				JsonElement granularSource = getGranularSource(elementSource, turn, deps, aces);
				transform = jsonMystique.transform(granularSource, value, deps);
			}
		}
		return transform;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy