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

com.maxleap.code.impl.AbstractDefiner Maven / Gradle / Ivy

There is a newer version: 2.4.9
Show newest version
package com.maxleap.code.impl;

import com.maxleap.code.*;

import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * Created by stream.
 */
abstract class AbstractDefiner implements Definer {

  protected Map> handlers;
  //what kind of action.
  protected RequestCategory category;

  protected AbstractDefiner() {
    this.handlers = new ConcurrentHashMap>();
  }

  @Override
  public MLHandler getHandler(String name) {
    return (MLHandler) handlers.get(name);
  }

  @Override
  public RequestCategory getCategory() {
    return category;
  }

  @Override
  public void define(String name, MLHandler handler) {
    handlers.put(name, handler);
  }

  @Override
  public Set getHandlerNames() {
    return handlers.keySet();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy