com.mindoo.domino.jna.internal.structs.html.ValueUnion Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-jna Show documentation
Show all versions of domino-jna Show documentation
Java project to access the HCL Domino C API using Java Native Access (JNA)
package com.mindoo.domino.jna.internal.structs.html;
import java.security.AccessController;
import java.security.PrivilegedAction;
import com.mindoo.domino.jna.internal.structs.NoteIdStruct;
import com.mindoo.domino.jna.internal.structs.NotesUniversalNoteIdStruct;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.Union;
/**
* native declaration : line 2
* This file was autogenerated by JNAerator,
* a tool written by Olivier Chafik that uses a few opensource projects..
* For help, please visit NativeLibs4Java , Rococoa, or JNA.
*/
public class ValueUnion extends Union {
/** When Type == CAVT_Int, value as int */
public int n;
/**
* When Type == CAVT_NoteId, value as NOTEID
* C type : NOTEID
*/
public NoteIdStruct nid;
/**
* When Type == CAVT_UNID, value as UNID
* C type : UNID
*/
public NotesUniversalNoteIdStruct unid;
/**
* When Type == CAVT_String, value as nul-terminated string
* C type : char*
*/
public Pointer name;
/**
* When Type == CAVT_StringList,value is list of NULL terminated strings.
* C type : slist_struct
*/
public StringListStruct slist;
/** native declaration : line 8 */
public ValueUnion() {
super();
}
public static ValueUnion newInstance() {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public ValueUnion run() {
return new ValueUnion();
}
});
}
/**
* @param unid When Type == CAVT_UNID, value as UNID
* C type : UNID
*/
public ValueUnion(NotesUniversalNoteIdStruct unid) {
super();
this.unid = unid;
setType(NotesUniversalNoteIdStruct.class);
}
public static ValueUnion newInstance(final NotesUniversalNoteIdStruct unid) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public ValueUnion run() {
return new ValueUnion(unid);
}
});
}
/**
* @param slist When Type == CAVT_StringList,value is list of NULL terminated strings.
* C type : slist_struct
*/
public ValueUnion(StringListStruct slist) {
super();
this.slist = slist;
setType(StringListStruct.class);
}
public static ValueUnion newInstance(final StringListStruct slist) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public ValueUnion run() {
return new ValueUnion(slist);
}
});
}
/**
* @param s When Type == CAVT_String, value as nul-terminated string
* C type : char*
*/
public ValueUnion(Pointer s) {
super();
this.name = s;
setType(Pointer.class);
}
public static ValueUnion newInstance(final Pointer s) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public ValueUnion run() {
return new ValueUnion(s);
}
});
}
public ValueUnion(NoteIdStruct nid) {
super();
this.nid = nid;
setType(NoteIdStruct.class);
}
public static ValueUnion newInstance(final NoteIdStruct nid) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public ValueUnion run() {
return new ValueUnion(nid);
}
});
}
/** @param n When Type == CAVT_Int, value as int */
public ValueUnion(int n) {
super();
this.n = n;
setType(Integer.TYPE);
}
public static ValueUnion newInstance(final int n) {
return AccessController.doPrivileged(new PrivilegedAction() {
@Override
public ValueUnion run() {
return new ValueUnion(n);
}
});
}
public static class ByReference extends ValueUnion implements Structure.ByReference {
};
public static class ByValue extends ValueUnion implements Structure.ByValue {
};
}