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

com.github.rexsheng.springboot.faster.system.user.domain.UserStateChangedEvent Maven / Gradle / Ivy

The newest version!
package com.github.rexsheng.springboot.faster.system.user.domain;

import org.springframework.context.ApplicationEvent;
import org.springframework.util.Assert;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class UserStateChangedEvent extends ApplicationEvent {

    private UserState state;

    public UserStateChangedEvent(Long userId, UserState state) {
        super(Arrays.asList(userId));
        Assert.notNull(state, "state must not be null");
        this.state = state;
    }

    public UserStateChangedEvent(UserState state) {
        super(Collections.emptyList());
        Assert.notNull(state, "state must not be null");
        this.state = state;
    }

    public UserStateChangedEvent(List userIds, UserState state) {
        super(userIds);
        Assert.notNull(state, "state must not be null");
        this.state = state;
    }

    public UserState getState() {
        return state;
    }

    public static enum UserState{
        DELETE,ADD,STATUS_CHANGED
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy