編程習慣1

判斷參數 ,拋出異常, 一個方法一個returnthis

public FixedLengthFrameDecoder(int frameLength) {
        if(frameLength <= 0) {
            throw new IllegalArgumentException("frameLength must be a positive integer: " + frameLength );
        }
        this.frameLength = frameLength;
 }
相關文章
相關標籤/搜索