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

org.ssssssss.magicapi.provider.FunctionServiceProvider Maven / Gradle / Ivy

package org.ssssssss.magicapi.provider;

import org.ssssssss.magicapi.adapter.Resource;
import org.ssssssss.magicapi.model.FunctionInfo;

public abstract class FunctionServiceProvider extends StoreServiceProvider {

	public FunctionServiceProvider(Resource workspace, GroupServiceProvider groupServiceProvider) {
		super(FunctionInfo.class, workspace, groupServiceProvider);
	}

	public boolean exists(FunctionInfo info) {
		return infos.values().stream()
				.anyMatch(it -> info.getGroupId().equals(it.getGroupId()) && (info.getName().equals(it.getName()) || info.getPath().equals(it.getPath())));
	}

	public boolean existsWithoutId(FunctionInfo info) {
		return infos.values().stream()
				.anyMatch(it -> !info.getId().equals(it.getId()) && info.getGroupId().equals(it.getGroupId()) && (info.getName().equals(it.getName()) || info.getPath().equals(it.getPath())));
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy