- // Only use if you know what you are doing!
- public BasicSequence( final Object identifier, final char[] mol_sequence, final TYPE type ) {
+ private static final void check( final String identifier, final String mol_sequence ) {
+ if ( ForesterUtil.isEmpty( identifier ) ) {
+ throw new IllegalArgumentException( "identifier of sequence cannot be empty" );
+ }
+ if ( ForesterUtil.isEmpty( mol_sequence ) ) {
+ throw new IllegalArgumentException( "molecular sequence cannot be empty" );
+ }
+ }
+
+ /**
+ * Only use if you know what you are doing!
+ *
+ */
+ public BasicSequence( final String identifier, final char[] mol_sequence, final TYPE type ) {
+ if ( ForesterUtil.isEmpty( identifier ) ) {
+ throw new IllegalArgumentException( "identifier of sequence cannot be empty" );
+ }
+ if ( ( mol_sequence == null ) || ( mol_sequence.length < 1 ) ) {
+ throw new IllegalArgumentException( "molecular sequence cannot be empty" );
+ }