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

aQute.bnd.classfile.ElementInfo Maven / Gradle / Ivy

The newest version!
package aQute.bnd.classfile;

import java.util.Optional;
import java.util.stream.Stream;

public abstract class ElementInfo {
	public final int			access;
	public final Attribute[]	attributes;

	protected ElementInfo(int access, Attribute[] attributes) {
		this.access = access;
		this.attributes = attributes;
	}

	public  Optional getAttribute(Class type) {
		return Stream.of(attributes)
			.filter(type::isInstance)
			.map(type::cast)
			.findFirst();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy