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

io.hypertrack.factory.EventFactory Maven / Gradle / Ivy

The newest version!
package io.hypertrack.factory;

import io.hypertrack.model.Event;
import io.hypertrack.net.HyperTrackClient;

import java.util.Map;

/**
 * Factory class for Event model.
 */
public class EventFactory extends HyperTrackFactory {
    private static String modelUrl = "events/";

    public EventFactory(HyperTrackClient client) {
        super(client);
    }

    @Override
    protected Event makeNew(Map params) {
        return new Event(params);
    }

    @Override
    protected String getModelUrl() {
        return modelUrl;
    }

    /**
     * Overriding create method as events cannot be created.
     *
     * @param   params      Map of instance parameters
     * @return
     */
    @Override
    public Event create(Map params) {
        throw new UnsupportedOperationException("Events cannot be created.");
    }

    /**
     * Overriding patch method as events cannot be patched.
     *
     * @param   event       Event object to be patched
     * @param   params      New params to be patched in instance
     */
    @Override
    public void patch(Event event, Map params) {
        throw new UnsupportedOperationException("Events cannot be patched.");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy