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

org.snapscript.studio.agent.ProcessModel Maven / Gradle / Ivy

There is a newer version: 1.4.6
Show newest version
package org.snapscript.studio.agent;

import java.util.HashMap;
import java.util.Map;

import org.snapscript.core.scope.Model;

public class ProcessModel implements Model {
   
   public static final String SHORT_ARGUMENTS = "args";
   public static final String LONG_ARGUMENTS = "arguments";
   
   private final Map values;
   private final Model model;
   
   public ProcessModel(Model model) {
      this.values = new HashMap();
      this.model = model;
   }
   
   public void addAttribute(String name, Object value) {
      values.put(name, value);
   }

   @Override
   public Object getAttribute(String name) {
      Object value = model.getAttribute(name);
      
      if(value == null) {
         return values.get(name);
      }
      return value;
   }
   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy