src/main/java/org/intellimate/izou/sdk/frameworks/presence/events/LeavingEvent.java
public static Optional<LeavingEvent> createLeavingEvent(Identification source, boolean strict, List<String> descriptors) {
        try {
            if (strict) {
                descriptors.add(STRICT_DESCRIPTOR);
            } else {
                descriptors.add(GENERAL_DESCRIPTOR);
            }
            descriptors.add(ID);
            descriptors.add(CommonEvents.Descriptors.NOT_INTERRUPT);
            LeavingEvent stopRequest = new LeavingEvent(source, descriptors);
            return Optional.of(stopRequest);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional<LeavingEvent> createLeavingEvent(Identification source, boolean strict, List<String> descriptors) {
        try {
            if (strict) {
                descriptors.add(STRICT_DESCRIPTOR);
            } else {
                descriptors.add(GENERAL_DESCRIPTOR);
            }
            descriptors.add(ID);
            descriptors.add(CommonEvents.Descriptors.NOT_INTERRUPT);
            LeavingEvent stopRequest = new LeavingEvent(source, descriptors);
            return Optional.of(stopRequest);
        } catch (IllegalArgumentException e) {
            return Optional.empty();
        }
    }
public static Optional < LeavingEvent > createLeavingEvent ( Identification source , boolean strict , List < String > descriptors ) { try { if ( strict ) { descriptors . add ( STRICT_DESCRIPTOR ) ; } else { descriptors . add ( GENERAL_DESCRIPTOR ) ; } descriptors . add ( ID ) ; descriptors . add ( CommonEvents . Descriptors . NOT_INTERRUPT ) ; LeavingEvent stopRequest = new LeavingEvent ( source , descriptors ) ; return Optional . of ( stopRequest ) ; } catch ( IllegalArgumentException e ) { return Optional . empty ( ) ; } }
creates a new LeavingEvent
@param source the caller
@param strict whether the addon can guarantee that the user is around
@param descriptors the descriptors
@return the optional PresenceEvent
creates a new LeavingEvent