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

com.davfx.ninio.snmp.SnmpServerUtils Maven / Gradle / Ivy

package com.davfx.ninio.snmp;

import java.util.Map;
import java.util.SortedMap;

public final class SnmpServerUtils {
	private SnmpServerUtils() {
	}
	
	public static SnmpServer.Handler from(final SortedMap map) {
		return new SnmpServer.Handler() {
			@Override
			public void from(Oid oid, Callback callback) {
				SortedMap tail = map.tailMap(oid);
				for (Map.Entry e : tail.entrySet()) {
					if (!callback.handle(e.getKey(), e.getValue())) {
						break;
					}
				}
			}
		};
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy