text:
package wae.thesis.indiv.app.config;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * Created by Nguyen Tan Dat.
 */

@Configuration
@NoArgsConstructor
@Data
public class JwtConfig {

    @Value("${jwt.config.tokenExpiredTime}")
    private int tokenExpirationTime;

    @Value("${jwt.config.tokenIssuer}")
    private String tokenIssuer;

    @Value("${jwt.config.tokenSigningKey}")
    private String tokenSigningKey;

    @Value("${jwt.config.refreshTokenExpiredTime}")
    private int refreshTokenExpTime;

    @Value("${jwt.config.tokenHeaderPrefix}")
    private String tokenHeaderPrefix;
}

domain: java


text:
package org.manticore;

import java.io.IOException;
import java.io.InputStream;
import org.jruby.Ruby;
import org.jruby.RubyClass;
import org.jruby.RubyString;
import org.jruby.RubyObject;
import org.jruby.RubyModule;
import org.jruby.util.ByteList;
import org.jruby.anno.JRubyMethod;
import org.jruby.runtime.Block;
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.load.Library;
import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
import org.apache.http.HttpEntity;
import org.apache.http.util.EntityUtils;
import org.apache.http.protocol.HTTP;
import org.jcodings.Encoding;

public class Manticore implements Library {

  public void load(final Ruby ruby, boolean _) {
    RubyModule manticore = ruby.defineModule("Manticore");
    RubyClass converter = ruby.defineClassUnder("EntityConverter", ruby.getObject(), new ObjectAllocator() {
        public IRubyObject allocate(Ruby ruby, RubyClass rc) {
            return new EntityConverter(ruby, rc);
        }
    }, manticore);
    converter.defineAnnotatedMethods(EntityConverter.class);
  }

  public class EntityConverter extends RubyObject {
    public EntityConverter(Ruby ruby, RubyClass rubyClass) {
      super(ruby, rubyClass);
    }

    @JRubyMethod(name = "read_entity")
    public IRubyObject readEntity(ThreadContext context, IRubyObject rEntity, Block block) throws IOException {
      HttpEntity entity = (HttpEntity)rEntity.toJava(HttpEntity.class);
      String charset = EntityUtils.getContentCharSet(entity);
      if(charset == null) { charset = HTTP.DEFAULT_CONTENT_CHARSET; }
      Encoding encoding;
      try {
        encoding = context.getRuntime().getEncodingService().getEncodingFromString(charset);
      } catch(Throwable e) {
        encoding = context.getRuntime().getEncodingService().getEncodingFromString(HTTP.DEFAULT_CONTENT_CHARSET);
      }

      if(block.isGiven()) {
        return streamEntity(context, entity, encoding, block);
      } else {
        return readWholeEntity(context, entity, encoding);
      }
    }

    private IRubyObject readWholeEntity(ThreadContext context, HttpEntity entity, Encoding encoding) throws IOException {
      ByteList bl = new ByteList(EntityUtils.toByteArray(entity), false);
      return RubyString.newStringShared(context.getRuntime(), bl, encoding);
    }

    private IRubyObject streamEntity(ThreadContext context, HttpEntity entity, Encoding encoding, Block block) throws IOException {
      InputStream instream = entity.getContent();
      if (instream == null) { return null; }
      String charset = EntityUtils.getContentCharSet(entity);
      if(charset == null) { charset = HTTP.DEFAULT_CONTENT_CHARSET; }

      int i = (int)entity.getContentLength();
      if (i < 0) { i = 4096; }

      if (charset == null) {
        charset = HTTP.DEFAULT_CONTENT_CHARSET;
      }

      try {
        byte[] tmp = new byte[4096];
        int l;
        while((l = instream.read(tmp)) != -1) {
          block.call( context, RubyString.newString(context.getRuntime(), new ByteList(tmp, 0, l, true), encoding) );
        }
      } finally {
        instream.close();
      }
      return context.nil;
    }
  }
}


text:
/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.opengroup.osdu.ingest.validation.schema;

import static org.assertj.core.api.Assertions.catchThrowable;
import static org.assertj.core.api.BDDAssertions.then;
import static org.opengroup.osdu.ingest.ResourceUtils.getResource;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.DisplayNameGeneration;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.opengroup.osdu.ingest.ReplaceCamelCase;
import org.opengroup.osdu.ingest.exception.ServerErrorException;

@ExtendWith(MockitoExtension.class)
@DisplayNameGeneration(ReplaceCamelCase.class)
class JsonValidationServiceImplTest {

  private static final String DRAFT_07_SCHEMA_PATH = "3-schemas/TinySchemaDraft7.json";
  private static final String DRAFT_06_SCHEMA_PATH = "3-schemas/TinySchemaDraft6.json";

  private ObjectMapper objectMapper = new ObjectMapper();
  private IJsonValidationService jsonValidationService = new JsonValidationServiceImpl();

  @Test
  void shouldValidateObjectByProvidedSchema() throws Exception {
    // given
    JsonNode schema = objectMapper.readTree(getResource(DRAFT_07_SCHEMA_PATH));
    JsonNode object = objectMapper.readTree("{}");

    // when
    Throwable thrown = catchThrowable(() -> jsonValidationService.validate(schema, object));

    // then
    then(thrown).isNull();
  }

  @Test
  void shouldThrownExceptionWhenUnableToValidateBySchema() throws Exception {
    // given
    JsonNode schema = objectMapper.readTree(getResource(DRAFT_06_SCHEMA_PATH));
    JsonNode object = objectMapper.readTree("{}");

    // when
    Throwable thrown = catchThrowable(() -> jsonValidationService.validate(schema, object));

    // then
    then(thrown)
        .isInstanceOf(ServerErrorException.class)
        .hasMessageMatching("Error creating json validation schema from json object: (.*)");
  }

}


text:
package com.fishercoder.solutions;

import java.util.HashMap;
import java.util.Map;

public class _1577 {
    public static class Solution1 {
        public int numTriplets(int[] nums1, int[] nums2) {
            long result = 0;
            for (long num : nums1) {
                result += twoProduct(num * num, nums2);
            }
            for (long num : nums2) {
                result += twoProduct(num * num, nums1);
            }
            return (int) result;
        }

        private long twoProduct(long product, int[] nums) {
            Map<Long, Long> map = new HashMap<>();
            long count = 0;
            for (long num : nums) {
                if (product % num == 0) {
                    count += map.getOrDefault(product / num, 0L);
                }
                map.put(num, map.getOrDefault(num, 0L) + 1);
            }
            return count;
        }

    }
}


text:
package ru.shemplo.profiler;

import java.io.*;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;

import java.util.*;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.stream.Collectors;

import java.util.concurrent.atomic.AtomicInteger;

import ru.shemplo.profiler.asm.ClassPatcher;
import ru.shemplo.profiler.log.Event;
import ru.shemplo.profiler.log.Event.EventType;
import ru.shemplo.profiler.log.EventLogger;
import ru.shemplo.snowball.annot.Snowflake;
import ru.shemplo.snowball.annot.Wind;
import ru.shemplo.snowball.annot.processor.Snowball;
import ru.shemplo.snowball.stuctures.Pair;
import ru.shemplo.snowball.utils.ClasspathUtils;

@Wind (blow = {ClassPatcher.class, EventLogger.class})
public class Profiler extends Snowball {

    public static void main (String ... args) throws Exception { shape (args); }

    public static String toName (String path) {
        return path.replace ('/', '.');
    }

    public static String toPath (String className) {
        return className.replace ('.', '/');
    }

    private ExtendedClassLoader classLoader;
    private ClassPatcher classPatcher;
    private EventLogger eventLogger;

    @Snowflake (manual = true)
    private String mainClass;

    @Override
    protected void onShaped (String ... args) {
        assert args.length > 0;

        final String fileName = args [0];
        args = subarray (args, 1);

        try {
            File file = new File (fileName);
            if (!file.canRead ()) {
                String message = "Failed to read JAR file";
                throw new IllegalStateException (message);
            }

            JarFile jar = new JarFile (file);
            profileJarFile (jar, args);
        } catch (IOException ioe) {

        }
    }

    @SuppressWarnings ("unchecked")
    private <T> T [] subarray (T [] array, int from) {
        if (from >= array.length && array.length > 0) {
            final Class <?> token = array [0].getClass ();
            return (T []) Array.newInstance (token, 0);
        }

        if (from < array.length && array.length > 0) {
            final Class <?> token = array [0].getClass ();
            T [] tmp = (T []) Array.newInstance (token, array.length - from);
            System.arraycopy (array, from, tmp, 0, tmp.length);
            return tmp;
        }

        return null;
    }

    public void profileJarFile (JarFile jar, String [] args) {
        mainClass = getMainClass (jar);

        System.out.println (">> Reading JAR file <<");
        List <JarEntry> classFiles = ClasspathUtils.getEntriesFromJAR (jar).stream ()
                                   . filter  (e ->  e.getName ().endsWith (".class"))
                                   . filter  (e -> !e.getName ().contains ("package-info"))
                                   . collect (Collectors.toList ());
        Queue <Pair <String, byte []>> classes = new LinkedList <> ();
        classFiles.forEach (f -> {
            byte [] content  = classPatcher.patch (readAllBytes (jar, f));
            String className = toName (f.getName ().replace (".class", ""));
            System.out.println (className);

            File file = new File ("generated", toName (f.getName ()));
            try {
                if (!file.getParentFile ().exists ()) {
                    file.getParentFile ().mkdir ();
                }
                if (!file.exists ()) { file.createNewFile (); }
            } catch (IOException ioe) { ioe.printStackTrace (); }

            try (OutputStream os = new FileOutputStream (file)) {
                os.write (content);
            } catch (IOException ioe) { ioe.printStackTrace (); }

            classes.add (Pair.mp (className, content));
        });

        while (!classes.isEmpty ()) {
            Pair <String, byte []> pair = classes.poll ();
            try {
                classLoader.defineClass (pair.F, pair.S);
            } catch (NoClassDefFoundError ncdfe) {
                classes.add (pair);
            }
        }

        try {
            System.out.println (">> Running main class of JAR file <<");
            Class <?> type = classLoader.loadClass (mainClass);
            type.getDeclaredMethod ("main", String [].class)
                .invoke (null, (Object) args);
        } catch (ClassNotFoundException cnfe) {
            cnfe.printStackTrace ();
            System.exit (1);
        } catch (IllegalAccessException | IllegalArgumentException
              | NoSuchMethodException | InvocationTargetException
              | SecurityException es) {
            es.printStackTrace ();
            System.exit (1);
        }

        System.out.println (">> Computing statistics <<");
        final List  <Event>   trace = new ArrayList <> ();
        final Stack <Integer> stack = new Stack <> ();
        AtomicInteger counter = new AtomicInteger ();
        eventLogger.getEvents ().stream ()
                   .sorted  ((a, b) -> Double.compare (a.getTime (), b.getTime ()))
                   .forEach (event -> {
                       if (event.getEventType ().equals (EventType.START)) {
                           stack.push (counter.getAndIncrement ());
                           trace.add  (event);
                       } else {
                           final Integer index = stack.pop ();
                           Event start = trace.get (index);

                           assert start.getMethodName ().equals (event.getMethodName ());
                           assert start.getClassName ().equals (event.getClassName ());
                           double time = (double) event.getTime () - start.getTime ();
                           start.setTime (time / 1_000_000); // to ms
                           start.setDepth (stack.size ());
                       }
                   });
        trace.forEach (event -> {
            String offset = new String (new char [event.getDepth () * 4]).replace ('\0', ' ');
            System.out.println (String.format (Locale.ENGLISH, "%s> %s # %s - %.2f [ms]", offset,
                                               event.getClassName (), event.getMethodName (),
                                               event.getTime ()));
        });
    }

    private String getMainClass (JarFile jar) {
        String mainClass = ClasspathUtils.getMainClassFromJar (jar)
                         . orElse (null);

        if (mainClass == null) {
           final String message = "Main class not found";
           throw new IllegalStateException (message);
        }

        return mainClass;
    }

    private byte [] readAllBytes (JarFile jar, JarEntry entry) {
        try (
            ByteArrayOutputStream baos = new ByteArrayOutputStream ();
            InputStream           is   = jar.getInputStream (entry);
        ) {
            byte [] buffer = new byte [1024 * 4];
            int read = -1;

            while ((read = is.read (buffer)) != -1) {
                baos.write (buffer, 0, read);
            }

            return baos.toByteArray ();
        } catch (IOException ioe) {
            throw new IllegalStateException (ioe);
        }
    }

}


text:
package systemUI;

import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.SwingUtilities;

import Operation.DataException;
import Users.User;

public class changePasswordUI extends JFrame implements ActionListener {

	private static final long serialVersionUID = 1L;

	private User user;
	private JLabel jl_password, jl_newpassword, jl_check;
	private JPasswordField jt_password, jt_newpassword, jt_check;
	private JPanel left, right, center, south;
	private Font font;
	private JButton sure, cancel;

	public changePasswordUI(User user) {
		this.user = user;

		font = new Font("宋体", Font.PLAIN, 48);
		jl_password = new JLabel("原密码：", SwingUtilities.RIGHT);
		jl_password.setFont(font);
		jl_newpassword = new JLabel("新密码：", SwingUtilities.RIGHT);
		jl_newpassword.setFont(font);
		jl_check = new JLabel("确认新密码：", SwingUtilities.RIGHT);
		jl_check.setFont(font);

		left = new JPanel();
		left.setLayout(new GridLayout(3,1));
		left.add(jl_password);
		left.add(jl_newpassword);
		left.add(jl_check);

		font = new Font("宋体",Font.PLAIN,40);
		jt_password = new JPasswordField();
		jt_password.setFont(font);
		jt_password.setEchoChar('*');
		jt_newpassword = new JPasswordField();
		jt_newpassword.setFont(font);
		jt_newpassword.setEchoChar('*');
		jt_check = new JPasswordField();
		jt_check.setFont(font);
		jt_check.setEchoChar('*');

		right = new JPanel();
		right.setLayout(new GridLayout(3,1));
		right.add(jt_password);
		right.add(jt_newpassword);
		right.add(jt_check);

		center = new JPanel();
		center.setLayout(new GridLayout(1, 2));
		center.add(left);
		center.add(right);

		font = new Font("宋体", Font.BOLD, 28);
		sure = new JButton("确认");
		sure.setFont(font);
		sure.addActionListener(this);
		cancel = new JButton("取消");
		cancel.setFont(font);
		cancel.addActionListener(this);

		south = new JPanel();
		south.setLayout(new GridLayout(1, 2));
		south.add(sure);
		south.add(cancel);
		south.setBorder(BorderFactory.createEmptyBorder(0, 120, 0, 120));

		this.add(center);
		this.add(south,BorderLayout.SOUTH);
		this.setTitle("修改密码");
		this.setVisible(true);
		this.pack();
		this.setResizable(true);
		this.setLocationRelativeTo(null);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(e.getSource() == cancel) {
			this.setVisible(false);
		}
		else if(e.getSource() == sure) {
			try {
				user.changeSelfInfo(new String(jt_password.getPassword()), new String(jt_newpassword.getPassword()), new String(jt_check.getPassword()));
				JOptionPane.showMessageDialog(changePasswordUI.this, "修改密码成功！", "提示", JOptionPane.INFORMATION_MESSAGE);
			} catch (DataException e1) {
				JOptionPane.showMessageDialog(changePasswordUI.this, e1.getString(), "提示", JOptionPane.INFORMATION_MESSAGE);
			}
		}
	}
}


text:
// $Id: Keccak512.java 189 2010-05-14 21:21:46Z tp $

package org.ethereum.crypto.cryptohash;

/**
 *
This class implements the Keccak-256 digest algorithm under the
 * {@link Digest} API.

 *
 *

 * ==========================(LICENSE BEGIN)============================
 *
 * Copyright (c) 2007-2010  Projet RNRT SAPHIR
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * ===========================(LICENSE END)=============================
 *

 *
 * @version   $Revision: 189 $
 * @author    Thomas Pornin <thomas.pornin@cryptolog.com>
 */

public class Keccak512 extends KeccakCore {

	/**
	 * Create the engine.
	 */
	public Keccak512()
	{
	}

	/** @see Digest */
	public Digest copy()
	{
		return copyState(new Keccak512());
	}

	/** @see Digest */
	public int getDigestLength()
	{
		return 64;
	}
}


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.hop.pipeline.transforms.regexeval;

import org.apache.hop.core.Const;
import org.apache.hop.core.Props;
import org.apache.hop.core.exception.HopException;
import org.apache.hop.core.row.IRowMeta;
import org.apache.hop.core.row.value.ValueMetaFactory;
import org.apache.hop.core.row.value.ValueMetaString;
import org.apache.hop.core.util.Utils;
import org.apache.hop.core.variables.IVariables;
import org.apache.hop.core.variables.Variables;
import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.pipeline.PipelineMeta;
import org.apache.hop.pipeline.transform.BaseTransformMeta;
import org.apache.hop.pipeline.transform.ITransformDialog;
import org.apache.hop.ui.core.dialog.BaseDialog;
import org.apache.hop.ui.core.dialog.ErrorDialog;
import org.apache.hop.ui.core.widget.ColumnInfo;
import org.apache.hop.ui.core.widget.LabelTextVar;
import org.apache.hop.ui.core.widget.StyledTextComp;
import org.apache.hop.ui.core.widget.TableView;
import org.apache.hop.ui.pipeline.transform.BaseTransformDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.events.*;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.*;

public class RegexEvalDialog extends BaseTransformDialog implements ITransformDialog {
  private static final Class<?> PKG = RegexEvalMeta.class; // For Translator

  private StyledTextComp wScript;

  private LabelTextVar wResultField;

  private CCombo wFieldEvaluate;

  private final RegexEvalMeta input;

  private Label wlReplaceFields;
  private Button wCanonEq;
  private Button wCaseInsensitive;
  private Button wComment;
  private Button wDotAll;
  private Button wMultiline;
  private Button wUnicode;
  private Button wUnix;
  private Button wUseVar;
  private Button wAllowCaptureGroups;
  private Button wReplaceFields;

  private Label wlFields;
  private TableView wFields;

  public RegexEvalDialog(
      Shell parent, IVariables variables, Object in, PipelineMeta tr, String sname) {
    super(parent, variables, (BaseTransformMeta) in, tr, sname);
    input = (RegexEvalMeta) in;
  }

  @Override
  public String open() {
    Shell parent = getParent();

    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN);
    props.setLook(shell);
    setShellImage(shell, input);

    ModifyListener lsMod = e -> input.setChanged();
    SelectionListener lsSel =
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        };
    changed = input.hasChanged();

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;

    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Shell.Title"));

    int middle = props.getMiddlePct();
    int margin = props.getMargin();

    // Buttons at the bottom
    //
    wOk = new Button(shell, SWT.PUSH);
    wOk.setText(BaseMessages.getString(PKG, "System.Button.OK"));
    wOk.addListener(SWT.Selection, e -> ok());
    wCancel = new Button(shell, SWT.PUSH);
    wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel"));
    wCancel.addListener(SWT.Selection, e -> cancel());
    setButtonPositions(new Button[] {wOk, wCancel}, margin, null);

    // Filename line
    wlTransformName = new Label(shell, SWT.RIGHT);
    wlTransformName.setText(BaseMessages.getString(PKG, "RegexEvalDialog.TransformName.Label"));
    props.setLook(wlTransformName);
    fdlTransformName = new FormData();
    fdlTransformName.left = new FormAttachment(0, 0);
    fdlTransformName.right = new FormAttachment(middle, -margin);
    fdlTransformName.top = new FormAttachment(0, margin);
    wlTransformName.setLayoutData(fdlTransformName);
    wTransformName = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wTransformName.setText(transformName);
    props.setLook(wTransformName);
    wTransformName.addModifyListener(lsMod);
    fdTransformName = new FormData();
    fdTransformName.left = new FormAttachment(middle, 0);
    fdTransformName.top = new FormAttachment(0, margin);
    fdTransformName.right = new FormAttachment(100, 0);
    wTransformName.setLayoutData(fdTransformName);

    SashForm wSash = new SashForm(shell, SWT.VERTICAL);

    CTabFolder wTabFolder = new CTabFolder(wSash, SWT.BORDER);
    props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);

    // ////////////////////////
    // START OF GENERAL TAB ///
    // ////////////////////////

    CTabItem wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
    wGeneralTab.setText(BaseMessages.getString(PKG, "RegexEvalDialog.GeneralTab.TabTitle"));

    Composite wGeneralComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wGeneralComp);

    FormLayout generalLayout = new FormLayout();
    generalLayout.marginWidth = 3;
    generalLayout.marginHeight = 3;
    wGeneralComp.setLayout(generalLayout);

    // Transform Settings grouping?
    // ////////////////////////
    // START OF Transform Settings GROUP
    //

    Group wTransformSettings = new Group(wGeneralComp, SWT.SHADOW_NONE);
    props.setLook(wTransformSettings);
    wTransformSettings.setText(
        BaseMessages.getString(PKG, "RegexEvalDialog.Group.TransformSettings.Label"));

    FormLayout groupLayout = new FormLayout();
    groupLayout.marginWidth = 10;
    groupLayout.marginHeight = 10;
    wTransformSettings.setLayout(groupLayout);

    // fieldevaluate
    Label wlfieldevaluate = new Label(wTransformSettings, SWT.RIGHT);
    wlfieldevaluate.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Matcher.Label"));
    props.setLook(wlfieldevaluate);
    FormData fdlfieldevaluate = new FormData();
    fdlfieldevaluate.left = new FormAttachment(0, 0);
    fdlfieldevaluate.top = new FormAttachment(wTransformName, margin);
    fdlfieldevaluate.right = new FormAttachment(middle, -margin);
    wlfieldevaluate.setLayoutData(fdlfieldevaluate);
    wFieldEvaluate = new CCombo(wTransformSettings, SWT.BORDER | SWT.READ_ONLY);
    wFieldEvaluate.setEditable(true);
    props.setLook(wFieldEvaluate);
    wFieldEvaluate.addModifyListener(lsMod);
    FormData fdfieldevaluate = new FormData();
    fdfieldevaluate.left = new FormAttachment(middle, margin);
    fdfieldevaluate.top = new FormAttachment(wTransformName, margin);
    fdfieldevaluate.right = new FormAttachment(100, -margin);
    wFieldEvaluate.setLayoutData(fdfieldevaluate);
    wFieldEvaluate.addSelectionListener(lsSel);
    wFieldEvaluate.addFocusListener(
        new FocusListener() {
          @Override
          public void focusLost(FocusEvent e) {}

          @Override
          public void focusGained(FocusEvent e) {
            Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
            shell.setCursor(busy);
            getPreviousFields();
            shell.setCursor(null);
            busy.dispose();
          }
        });

    // Output Fieldame

    wResultField =
        new LabelTextVar(
            variables,
            wTransformSettings,
            BaseMessages.getString(PKG, "RegexEvalDialog.ResultField.Label"),
            BaseMessages.getString(PKG, "RegexEvalDialog.ResultField.Tooltip"));

    props.setLook(wResultField);
    wResultField.addModifyListener(lsMod);
    FormData fdResultField = new FormData();
    fdResultField.left = new FormAttachment(0, 0);
    fdResultField.top = new FormAttachment(wFieldEvaluate, margin);
    fdResultField.right = new FormAttachment(100, 0);
    wResultField.setLayoutData(fdResultField);

    // Allow capture groups?
    Label wlAllowCaptureGroups = new Label(wTransformSettings, SWT.RIGHT);
    wlAllowCaptureGroups.setText(
        BaseMessages.getString(PKG, "RegexEvalDialog.AllowCaptureGroups.Label"));
    props.setLook(wlAllowCaptureGroups);
    FormData fdlAllowCaptureGroups = new FormData();
    fdlAllowCaptureGroups.left = new FormAttachment(0, 0);
    fdlAllowCaptureGroups.top = new FormAttachment(wResultField, margin);
    fdlAllowCaptureGroups.right = new FormAttachment(middle, -margin);
    wlAllowCaptureGroups.setLayoutData(fdlAllowCaptureGroups);
    wAllowCaptureGroups = new Button(wTransformSettings, SWT.CHECK);
    wAllowCaptureGroups.setToolTipText(
        BaseMessages.getString(PKG, "RegexEvalDialog.AllowCaptureGroups.Tooltip"));
    props.setLook(wAllowCaptureGroups);
    FormData fdAllowCaptureGroups = new FormData();
    fdAllowCaptureGroups.left = new FormAttachment(middle, margin);
    fdAllowCaptureGroups.top = new FormAttachment(wlAllowCaptureGroups, 0, SWT.CENTER);
    fdAllowCaptureGroups.right = new FormAttachment(100, 0);
    wAllowCaptureGroups.setLayoutData(fdAllowCaptureGroups);

    wAllowCaptureGroups.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            setFieldsEnabledStatus();
            input.setChanged();
          }
        });

    // Replace fields?
    wlReplaceFields = new Label(wTransformSettings, SWT.RIGHT);
    wlReplaceFields.setText(BaseMessages.getString(PKG, "RegexEvalDialog.ReplaceFields.Label"));
    props.setLook(wlReplaceFields);
    FormData fdlReplaceFields = new FormData();
    fdlReplaceFields.left = new FormAttachment(0, 0);
    fdlReplaceFields.top = new FormAttachment(wAllowCaptureGroups, margin);
    fdlReplaceFields.right = new FormAttachment(middle, -margin);
    wlReplaceFields.setLayoutData(fdlReplaceFields);
    wReplaceFields = new Button(wTransformSettings, SWT.CHECK);
    wReplaceFields.setToolTipText(
        BaseMessages.getString(PKG, "RegexEvalDialog.ReplaceFields.Tooltip"));
    props.setLook(wReplaceFields);
    FormData fdReplaceFields = new FormData();
    fdReplaceFields.left = new FormAttachment(middle, margin);
    fdReplaceFields.top = new FormAttachment(wlReplaceFields, 0, SWT.CENTER);
    fdReplaceFields.right = new FormAttachment(100, 0);
    wReplaceFields.setLayoutData(fdReplaceFields);

    wReplaceFields.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            input.setChanged();
          }
        });

    // settings layout
    FormData fdTransformSettings = new FormData();
    fdTransformSettings.left = new FormAttachment(0, margin);
    fdTransformSettings.top = new FormAttachment(wTransformName, margin);
    fdTransformSettings.right = new FormAttachment(100, -margin);
    wTransformSettings.setLayoutData(fdTransformSettings);

    // ///////////////////////////////////////////////////////////
    // / END OF TRANSFORM SETTINGS GROUP
    // ///////////////////////////////////////////////////////////

    // Script line
    Label wlScript = new Label(wGeneralComp, SWT.NONE);
    wlScript.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Javascript.Label"));
    props.setLook(wlScript);
    FormData fdlScript = new FormData();
    fdlScript.left = new FormAttachment(0, 0);
    fdlScript.top = new FormAttachment(wTransformSettings, margin);
    wlScript.setLayoutData(fdlScript);

    Button wbTestRegExScript = new Button(wGeneralComp, SWT.PUSH | SWT.CENTER);
    props.setLook(wbTestRegExScript);
    wbTestRegExScript.setText(BaseMessages.getString(PKG, "RegexEvalDialog.TestScript.Label"));
    FormData fdbTestRegExScript = new FormData();
    fdbTestRegExScript.right = new FormAttachment(100, -margin);
    fdbTestRegExScript.top = new FormAttachment(wTransformSettings, margin);
    wbTestRegExScript.setLayoutData(fdbTestRegExScript);
    wbTestRegExScript.addListener(SWT.Selection, e -> testRegExScript());

    // Variable substitution?
    Label wlUseVar = new Label(wGeneralComp, SWT.NONE);
    wlUseVar.setText(BaseMessages.getString(PKG, "RegexEvalDialog.UseVar.Label"));
    props.setLook(wlUseVar);
    FormData fdlUseVar = new FormData();
    fdlUseVar.left = new FormAttachment(0, margin);
    fdlUseVar.bottom = new FormAttachment(100, 0);
    wlUseVar.setLayoutData(fdlUseVar);
    wUseVar = new Button(wGeneralComp, SWT.CHECK);
    wUseVar.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.UseVar.Tooltip"));
    props.setLook(wUseVar);
    FormData fdUseVar = new FormData();
    fdUseVar.left = new FormAttachment(wlUseVar, margin);
    fdUseVar.top = new FormAttachment(wlUseVar, 0, SWT.CENTER);
    wUseVar.setLayoutData(fdUseVar);
    wUseVar.addSelectionListener(lsSel);
    Composite wBottom = new Composite(wSash, SWT.NONE);
    props.setLook(wBottom);

    wScript =
        new StyledTextComp(
            variables,
            wGeneralComp,
            SWT.MULTI | SWT.LEFT | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    wScript.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Script.Label"));
    props.setLook(wScript, Props.WIDGET_STYLE_FIXED);
    wScript.addModifyListener(lsMod);
    FormData fdScript = new FormData();
    fdScript.left = new FormAttachment(0, 0);
    fdScript.top = new FormAttachment(wbTestRegExScript, margin);
    fdScript.right = new FormAttachment(100, -10);
    fdScript.bottom = new FormAttachment(wUseVar, -2 * margin);
    wScript.setLayoutData(fdScript);

    FormLayout bottomLayout = new FormLayout();
    bottomLayout.marginWidth = Const.FORM_MARGIN;
    bottomLayout.marginHeight = Const.FORM_MARGIN;
    wBottom.setLayout(bottomLayout);

    Label wSeparator = new Label(wBottom, SWT.SEPARATOR | SWT.HORIZONTAL);
    FormData fdSeparator = new FormData();
    fdSeparator.left = new FormAttachment(0, 0);
    fdSeparator.right = new FormAttachment(100, 0);
    fdSeparator.top = new FormAttachment(0, -margin + 2);
    wSeparator.setLayoutData(fdSeparator);

    wlFields = new Label(wBottom, SWT.NONE);
    wlFields.setText(BaseMessages.getString(PKG, "RegexEvalDialog.Fields.Label"));
    wlFields.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.Fields.Tooltip"));
    props.setLook(wlFields);
    FormData fdlFields = new FormData();
    fdlFields.left = new FormAttachment(0, 0);
    fdlFields.top = new FormAttachment(wSeparator, 0);
    wlFields.setLayoutData(fdlFields);

    final int fieldsRows = input.getFieldName().length;

    ColumnInfo[] columnInfo =
        new ColumnInfo[] {
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.NewField"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Type"),
              ColumnInfo.COLUMN_TYPE_CCOMBO,
              ValueMetaFactory.getValueMetaNames()),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Length"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Precision"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Format"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Group"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Decimal"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Currency"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.Nullif"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.IfNull"),
              ColumnInfo.COLUMN_TYPE_TEXT,
              false),
          new ColumnInfo(
              BaseMessages.getString(PKG, "RegexEvalDialog.ColumnInfo.TrimType"),
              ColumnInfo.COLUMN_TYPE_CCOMBO,
              ValueMetaString.trimTypeDesc,
              true),
        };

    wFields =
        new TableView(
            variables,
            wBottom,
            SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI,
            columnInfo,
            fieldsRows,
            lsMod,
            props);

    FormData fdFields = new FormData();
    fdFields.left = new FormAttachment(0, 0);
    fdFields.top = new FormAttachment(wlFields, margin);
    fdFields.right = new FormAttachment(100, 0);
    fdFields.bottom = new FormAttachment(100, 0);
    wFields.setLayoutData(fdFields);

    FormData fdGeneralComp = new FormData();
    fdGeneralComp.left = new FormAttachment(0, 0);
    fdGeneralComp.top = new FormAttachment(0, 0);
    fdGeneralComp.right = new FormAttachment(100, 0);
    fdGeneralComp.bottom = new FormAttachment(100, 0);
    wGeneralComp.setLayoutData(fdGeneralComp);

    wGeneralComp.layout();
    wGeneralTab.setControl(wGeneralComp);
    props.setLook(wGeneralComp);

    // ///////////////////////////////////////////////////////////
    // / END OF GENERAL TAB
    // ///////////////////////////////////////////////////////////

    // ////////////////////////
    // START OF CONTENT TAB///
    // /
    CTabItem wContentTab = new CTabItem(wTabFolder, SWT.NONE);
    wContentTab.setText(BaseMessages.getString(PKG, "RegexEvalDialog.ContentTab.TabTitle"));

    FormLayout contentLayout = new FormLayout();
    contentLayout.marginWidth = 3;
    contentLayout.marginHeight = 3;

    Composite wContentComp = new Composite(wTabFolder, SWT.NONE);
    props.setLook(wContentComp);
    wContentComp.setLayout(contentLayout);

    // Transform RegexSettings grouping?
    // ////////////////////////
    // START OF RegexSettings GROUP
    //

    Group wRegexSettings = new Group(wContentComp, SWT.SHADOW_NONE);
    props.setLook(wRegexSettings);
    wRegexSettings.setText("Regex Settings");

    FormLayout regexLayout = new FormLayout();
    regexLayout.marginWidth = 10;
    regexLayout.marginHeight = 10;
    wRegexSettings.setLayout(regexLayout);

    // Canon_Eq?
    Label wlCanonEq = new Label(wRegexSettings, SWT.RIGHT);
    wlCanonEq.setText(BaseMessages.getString(PKG, "RegexEvalDialog.CanonEq.Label"));
    props.setLook(wlCanonEq);
    FormData fdlCanonEq = new FormData();
    fdlCanonEq.left = new FormAttachment(0, 0);
    fdlCanonEq.top = new FormAttachment(wTransformSettings, margin);
    fdlCanonEq.right = new FormAttachment(middle, -margin);
    wlCanonEq.setLayoutData(fdlCanonEq);
    wCanonEq = new Button(wRegexSettings, SWT.CHECK);
    wCanonEq.setToolTipText(BaseMessages.getString(PKG, "RegexEvalDialog.CanonEq.Tooltip"));
    props.setLook(wCanonEq);
    FormData fdCanonEq = new FormData();
    fdCanonEq.left = new FormAttachment(middle, 0);


text:
package cz.muni.fi.pa165.methanolmanager.frontend.client.bottles;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HasHandlers;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import cz.muni.fi.pa165.methanolmanager.frontend.client.i18n.ApplicationMessages;
import cz.muni.fi.pa165.methanolmanager.frontend.client.rest.BottleService;
import cz.muni.fi.pa165.methanolmanager.frontend.client.utils.NotificationUtils;
import cz.muni.fi.pa165.methanolmanager.service.dto.BottleDto;
import org.fusesource.restygwt.client.Method;
import org.fusesource.restygwt.client.MethodCallback;

import java.util.Collection;

public class BottleStamper implements HasHandlers {

    private final EventBus eventBus;
    private final BottleService bottleService;
    private final ApplicationMessages messages;

    private int outstandingStampRequests;

    @Inject
    BottleStamper(EventBus eventBus, BottleService bottleService, ApplicationMessages messages) {
        this.eventBus = eventBus;
        this.bottleService = bottleService;
        this.messages = messages;
    }

    public void stampBottles(Collection<BottleDto> bottlesToStamp) {
        outstandingStampRequests = 0;
        for (final BottleDto bottle : bottlesToStamp){
            if (bottle.getStampDate() == null) {
                outstandingStampRequests++;
                bottleService.stampBottle(bottle.getId(), new MethodCallback<Void>() {
                    @Override
                    public void onFailure(Method method, Throwable exception) {
                        NotificationUtils.error(messages.stampBottleError(bottle.getName(), exception.getLocalizedMessage()));
                        stampRequestDone();
                    }

                    @Override
                    public void onSuccess(Method method, Void response) {
                        NotificationUtils.info(messages.bottleStamped(bottle.getName()));
                        stampRequestDone();
                    }
                });
            }
        }
    }

    private void stampRequestDone() {
        if (--outstandingStampRequests == 0) {
            AllBottlesStampedEvent.fire(this);
        }
    }

    @Override
    public void fireEvent(GwtEvent<?> event) {
        eventBus.fireEvent(event);
    }
}


text:
package com.gxwuz.ly.shetuan.action;

import com.gxwuz.ly.shetuan.entity.ResponseData;
import com.gxwuz.ly.shetuan.entity.User;
import com.gxwuz.ly.shetuan.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class LoginController extends BaseController {

    @Autowired
    UserService userService;

    @RequestMapping("/login")
    public ResponseData<User> login(String stuNo, String pwd, User u) {

        logger.info("我我我登录-----");
        ResponseData<User> response = new ResponseData<>();
        try {
            List<User> users = new ArrayList<>();
            User user =  userService.login(stuNo, pwd);
            logger.info("查询结果"+stuNo + " "+ pwd + " " +u);
            if (user != null) {
                users.add(user);
                response.setCode(1);
                response.setDatas(users);
                response.setMsg("登录成功!");
            }else {
                response.setCode(0);
                response.setMsg("登录失败!");
            }
        } catch (Exception e) {
            response.setCode(0);
            response.setMsg("登录失败!");
            e.printStackTrace();
        }
        return response;

    }
}


text:
package tmy.java.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import tmy.java.Bean.BlogMessage;
import tmy.java.Dao.MessageManageDao;
import tmy.java.Service.MessageManageService;

import java.util.List;

/**
 * Created by Zt on 2018.8.7
 * MessageManageServiceImpl
 * 实现MessageManageService功能
 */

@Transactional(propagation= Propagation.REQUIRED,isolation= Isolation.DEFAULT)  //表示数据库隔离级别为如果当前有就使用当前，如果没有就创建新的事务，
//隔离级别为：读已提交，也就是数据在写入的时候是无法被读的，只有提交后才能让其他事务读取，防止数据库发生脏读
@Service("messageManageService")
public class MessageManageServiceImpl implements MessageManageService {
    @Autowired
    private MessageManageDao messageManageDao;

    @Override
    public List<BlogMessage> getAllByManager(String loginName){
        List<BlogMessage> blogMessages = messageManageDao.findAllByManager(loginName);
        return blogMessages;
    }

}


text:
package com.industrial.controller;

import com.industrial.common.core.controller.BaseController;
import com.industrial.common.core.domain.AjaxResult;
import com.industrial.common.core.domain.ResponseCode;
import com.industrial.common.core.domain.ResponseResult;
import com.industrial.common.dto.ProductDto;
import com.industrial.common.dto.ProductPriceDto;
import com.industrial.common.pojo.ProductExcel;
import com.industrial.common.utils.poi.ExcelUtil;
import com.industrial.common.vo.CheckVo;
import com.industrial.common.vo.EnableVo;
import com.industrial.common.vo.ProductVo;
import com.industrial.domin.AppProduct;
import com.industrial.domin.AppProductPrice;
import com.industrial.service.AppProductPriceService;
import com.industrial.service.AppProductService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author zhu
 * @date 2021年12月24日 8:51
 */
@RestController
@RequestMapping("/product")
public class AppProductController extends BaseController {
    @Resource
    private AppProductService productService;
    @Resource
    private AppProductPriceService productPriceService;
    public static final Byte SAVE_STATUS = 1;
    public static final Byte APPROVAL_STATUS = 2;
    public static final Byte PUTAWAY_STATUS = 3;
    public static final Byte SOLD_OUT_STATUS = 4;
    public static final String DEFAULT_IMAGE_ADDRESS = "Default image address";

    /**
     * 根据ID查询商品详情
     */
    @GetMapping("/details")
    public ResponseResult<ProductDto> details(@RequestParam Integer productId) {
        ResponseResult<ProductDto> result = null;
        ProductDto productDto = productService.selectProductById(productId);
        result = ResponseResult.success(productDto);
        return result;
    }

    /**
     * 根据分类ID查询与商品名称
     * status = 3 已经上架的商品
     */
    @GetMapping("/classify")
    public ResponseResult<List<ProductDto>> classify(@RequestParam(defaultValue = "0") Integer categoryId, @RequestParam(defaultValue = "") String productName) {
        ResponseResult<List<ProductDto>> result = null;
        startPage();
        List<ProductDto> productDto = productService.selectProductByCategoryId(categoryId, productName, 3);

        result = ResponseResult.success(productDto);
        return result;
    }

    /**
     * 根据状态查询商品
     * status = 1 保存商品
     * status = 2 待审核商品
     * status = 3 审核成功商品(上架商品)
     */
    @GetMapping("/status")
    public ResponseResult<List<ProductDto>> status(@RequestParam Integer status) {
        ResponseResult<List<ProductDto>> result = null;
        startPage();
        List<ProductDto> productDto = productService.selectProductByStatus(status);
        result = ResponseResult.success(productDto);
        return result;
    }

    /**
     * 保存商品
     * 成为保存商品
     * 默认 status = 1
     */
    @PostMapping("/save")
    public ResponseResult save(@RequestBody ProductVo productVo) {
        ResponseResult result = null;
        if (productService.insert(productVo)) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }

    /**
     * 商品审核
     * 成功 status = 3 上架商品
     * 失败 status = 2 成为待审核
     */
    @PostMapping("/check")
    public ResponseResult check(@RequestBody CheckVo checkVo) {
        ResponseResult result = null;
        int status = APPROVAL_STATUS;
        if (checkVo.getCheck()) {
            status = PUTAWAY_STATUS;
        }
        if (productService.changeStatus(status, checkVo.getId())) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }

    /**
     * 商品删除
     *
     * @param productId
     * @return
     */
    @DeleteMapping("/remove")
    public ResponseResult remove(@RequestParam Integer productId) {
        ResponseResult result = null;
        if (productService.remove(productId)) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;

    }

    /**
     * 商品禁用与启用
     * false 禁用 true 启用
     * 状态为0为禁用
     *
     * @param enableVo
     * @return
     */
    @PostMapping("/enable")
    public ResponseResult enable(@RequestBody EnableVo enableVo) {
        ResponseResult result = null;
        if (productService.changeEnabled(enableVo.getProductId(), enableVo.getEnable())) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }

    /**
     * 商品更新
     *
     * @param productVo
     * @return
     */
    @PutMapping("/update")
    public ResponseResult update(@RequestBody ProductVo productVo) {
        ResponseResult result = null;
        if (productService.update(productVo)) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }

    /**
     * 商品批量上架
     * status = 2
     *
     * @return
     */
    @PostMapping("putaway")
    public ResponseResult putaway(@RequestBody List<Integer> ids) {
        ResponseResult result = null;
        if (productService.putaway(ids, (byte) PUTAWAY_STATUS)) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }

    /**
     * 商品批量下架
     * status = 4
     *
     * @return
     */
    @PostMapping("soldOut")
    public ResponseResult soldOut(@RequestBody List<Integer> ids) {
        ResponseResult result = null;
        if (productService.soldOut(ids, (byte) SOLD_OUT_STATUS)) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }

    /**
     * 编辑商品报价
     */
    @PostMapping("prices")
    public ResponseResult prices(@RequestBody List<AppProductPrice> productPriceList) {
        ResponseResult result = null;
        if (productPriceService.update(productPriceList)) {
            result = ResponseResult.success();
        } else {
            result = ResponseResult.error(ResponseCode.ERROR);
        }
        return result;
    }
    /**
     * 商品报价展示
     */
    @PostMapping("prices/show")
    public ResponseResult<List<ProductPriceDto>> pricesShow(@RequestBody List<Integer> productPriceId) {
        List<ProductPriceDto> productPriceDtoList = productPriceService.selectList(productPriceId);
        return ResponseResult.success(productPriceDtoList);
    }
    /**
     * 根据活动ID查询
     */
    @PostMapping("prices/activity")
    public ResponseResult<List<ProductPriceDto>> pricesActivity(@RequestBody List<Integer> activityId) {
        List<ProductPriceDto> productPriceDtoList = productPriceService.selectListByActivityId(activityId);
        return ResponseResult.success(productPriceDtoList);
    }
    /**
     * 导出商品分类列表
     */
    @PostMapping("/export")
    public void export(HttpServletResponse response, @RequestBody List<Integer> ids) {
        List<ProductExcel> productList = productService.selectProductExcelList(ids);
        ExcelUtil<ProductExcel> util = new ExcelUtil<ProductExcel>(ProductExcel.class);
        util.exportExcel(response, productList, "商品数据");
    }
    /**
     * 下载模板
     */
    @GetMapping("/importTemplate")
    public AjaxResult importTemplate() {
        ExcelUtil<ProductExcel> util = new ExcelUtil<ProductExcel>(ProductExcel.class);
        return util.importTemplateExcel("商品数据");
    }
    /**
     * 导入
     */
    @PostMapping("/importProduct")
    public AjaxResult importProduct(MultipartFile file, boolean updateSupport) throws Exception {
        ExcelUtil<AppProduct> util = new ExcelUtil<AppProduct>(AppProduct.class);
        List<AppProduct> productList = util.importExcel(file.getInputStream());
        String operName = getUsername();
        String message = productService.importData(productList, updateSupport, operName);
        return AjaxResult.success(message);
    }

}


text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * gradle plugin from the resource data it found. It
 * should not be modified by hand.
 */
package android.support.coreutils;

public final class R {
    public static final class attr {
        public static final int font = 0x7f020080;
        public static final int fontProviderAuthority = 0x7f020082;
        public static final int fontProviderCerts = 0x7f020083;
        public static final int fontProviderFetchStrategy = 0x7f020084;
        public static final int fontProviderFetchTimeout = 0x7f020085;
        public static final int fontProviderPackage = 0x7f020086;
        public static final int fontProviderQuery = 0x7f020087;
        public static final int fontStyle = 0x7f020088;
        public static final int fontWeight = 0x7f020089;
    }
    public static final class bool {
        public static final int abc_action_bar_embed_tabs = 0x7f030000;
    }
    public static final class color {
        public static final int notification_action_color_filter = 0x7f040042;
        public static final int notification_icon_bg_color = 0x7f040043;
        public static final int ripple_material_light = 0x7f04004e;
        public static final int secondary_text_default_material_light = 0x7f040050;
    }
    public static final class dimen {
        public static final int compat_button_inset_horizontal_material = 0x7f05004d;
        public static final int compat_button_inset_vertical_material = 0x7f05004e;
        public static final int compat_button_padding_horizontal_material = 0x7f05004f;
        public static final int compat_button_padding_vertical_material = 0x7f050050;
        public static final int compat_control_corner_material = 0x7f050051;
        public static final int notification_action_icon_size = 0x7f050061;
        public static final int notification_action_text_size = 0x7f050062;
        public static final int notification_big_circle_margin = 0x7f050063;
        public static final int notification_content_margin_start = 0x7f050064;
        public static final int notification_large_icon_height = 0x7f050065;
        public static final int notification_large_icon_width = 0x7f050066;
        public static final int notification_main_column_padding_top = 0x7f050067;
        public static final int notification_media_narrow_margin = 0x7f050068;
        public static final int notification_right_icon_size = 0x7f050069;
        public static final int notification_right_side_padding_top = 0x7f05006a;
        public static final int notification_small_icon_background_padding = 0x7f05006b;
        public static final int notification_small_icon_size_as_large = 0x7f05006c;
        public static final int notification_subtext_size = 0x7f05006d;
        public static final int notification_top_pad = 0x7f05006e;
        public static final int notification_top_pad_large_text = 0x7f05006f;
    }
    public static final class drawable {
        public static final int notification_action_background = 0x7f060056;
        public static final int notification_bg = 0x7f060057;
        public static final int notification_bg_low = 0x7f060058;
        public static final int notification_bg_low_normal = 0x7f060059;
        public static final int notification_bg_low_pressed = 0x7f06005a;
        public static final int notification_bg_normal = 0x7f06005b;
        public static final int notification_bg_normal_pressed = 0x7f06005c;
        public static final int notification_icon_background = 0x7f06005d;
        public static final int notification_template_icon_bg = 0x7f06005e;
        public static final int notification_template_icon_low_bg = 0x7f06005f;
        public static final int notification_tile_bg = 0x7f060060;
        public static final int notify_panel_notification_icon_bg = 0x7f060061;
    }
    public static final class id {
        public static final int action_container = 0x7f07000e;
        public static final int action_divider = 0x7f070010;
        public static final int action_image = 0x7f070011;
        public static final int action_text = 0x7f070017;
        public static final int actions = 0x7f070018;
        public static final int async = 0x7f07001e;
        public static final int blocking = 0x7f070021;
        public static final int chronometer = 0x7f07002f;
        public static final int forever = 0x7f070045;
        public static final int icon = 0x7f070048;
        public static final int icon_group = 0x7f070049;
        public static final int info = 0x7f07004c;
        public static final int italic = 0x7f07004d;
        public static final int line1 = 0x7f07004f;
        public static final int line3 = 0x7f070050;
        public static final int normal = 0x7f070059;
        public static final int notification_background = 0x7f07005a;
        public static final int notification_main_column = 0x7f07005b;
        public static final int notification_main_column_container = 0x7f07005c;
        public static final int right_icon = 0x7f070064;
        public static final int right_side = 0x7f070065;
        public static final int text = 0x7f070088;
        public static final int text2 = 0x7f070089;
        public static final int time = 0x7f07008e;
        public static final int title = 0x7f07008f;
    }
    public static final class integer {
        public static final int status_bar_notification_info_maxnum = 0x7f080004;
    }
    public static final class layout {
        public static final int notification_action = 0x7f09001e;
        public static final int notification_action_tombstone = 0x7f09001f;
        public static final int notification_template_custom_big = 0x7f090026;
        public static final int notification_template_icon_group = 0x7f090027;
        public static final int notification_template_part_chronometer = 0x7f09002b;
        public static final int notification_template_part_time = 0x7f09002c;
    }
    public static final class string {
        public static final int status_bar_notification_info_overflow = 0x7f0b0029;
    }
    public static final class style {
        public static final int TextAppearance_Compat_Notification = 0x7f0c00fe;
        public static final int TextAppearance_Compat_Notification_Info = 0x7f0c00ff;
        public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0c0101;
        public static final int TextAppearance_Compat_Notification_Time = 0x7f0c0104;
        public static final int TextAppearance_Compat_Notification_Title = 0x7f0c0106;
        public static final int Widget_Compat_NotificationActionContainer = 0x7f0c016f;
        public static final int Widget_Compat_NotificationActionText = 0x7f0c0170;
    }
    public static final class styleable {
        public static final int[] FontFamily = { 0x7f020082, 0x7f020083, 0x7f020084, 0x7f020085, 0x7f020086, 0x7f020087 };
        public static final int FontFamily_fontProviderAuthority = 0;
        public static final int FontFamily_fontProviderCerts = 1;
        public static final int FontFamily_fontProviderFetchStrategy = 2;
        public static final int FontFamily_fontProviderFetchTimeout = 3;
        public static final int FontFamily_fontProviderPackage = 4;
        public static final int FontFamily_fontProviderQuery = 5;
        public static final int[] FontFamilyFont = { 0x7f020080, 0x7f020088, 0x7f020089 };
        public static final int FontFamilyFont_font = 0;
        public static final int FontFamilyFont_fontStyle = 1;
        public static final int FontFamilyFont_fontWeight = 2;
    }
}


text:
package com.example.todoserver;

import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import java.sql.Timestamp;

@Entity
public class Todo {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @NotBlank
    private String text;

    @CreationTimestamp
    private Timestamp created;

    public Todo() {
    }

    public Todo(String text) {
        this.text = text;
    }

    public Long getId() {
        return id;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Timestamp getCreated() {
        return created;
    }

    @Override
    public String toString() {
        return "Todo{" +
                "id=" + id +
                ", text='" + text + '\'' +
                ", created=" + created +
                '}';
    }

}


text:
package io.digdag.core.log;

import java.util.List;
import java.util.ArrayList;
import java.util.zip.GZIPOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.time.Instant;
import java.time.ZoneId;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.nio.file.Files;
import java.nio.file.DirectoryStream;
import com.google.inject.Inject;
import com.google.common.base.Optional;
import com.google.common.base.Throwables;
import com.google.common.io.ByteStreams;
import io.digdag.spi.LogServer;
import io.digdag.spi.LogServerFactory;
import io.digdag.spi.LogFilePrefix;
import io.digdag.spi.LogFileHandle;
import io.digdag.spi.ImmutableLogFileHandle;
import io.digdag.spi.DirectDownloadHandle;
import io.digdag.spi.DirectUploadHandle;
import io.digdag.spi.StorageFileNotFoundException;
import io.digdag.client.config.Config;
import java.time.format.DateTimeFormatter;
import static java.util.Locale.ENGLISH;
import static java.nio.charset.StandardCharsets.UTF_8;

public abstract class AbstractFileLogServer
    implements LogServer
{
    public abstract Optional<DirectUploadHandle> getDirectUploadHandle(String dateDir, String attemptDir, String fileName);

    protected abstract void putFile(String dateDir, String attemptDir, String fileName, byte[] gzData);

    protected abstract byte[] getFile(String dateDir, String attemptDir, String fileName)
            throws StorageFileNotFoundException;

    protected abstract void listFiles(String dateDir, String attemptDir, boolean enableDirectDownload, FileMetadataConsumer fileNameConsumer);

    public interface FileMetadataConsumer
    {
        public void accept(String name, long size, DirectDownloadHandle directOrNull);
    }

    @Override
    public Optional<DirectUploadHandle> getDirectUploadHandle(LogFilePrefix prefix, String taskName, Instant firstLogTime, String agentId)
    {
        String dateDir = LogFiles.formatDataDir(prefix);
        String attemptDir = LogFiles.formatSessionAttemptDir(prefix);
        String fileName = LogFiles.formatFileName(taskName, firstLogTime, agentId);
        return getDirectUploadHandle(dateDir, attemptDir, fileName);
    }

    @Override
    public String putFile(LogFilePrefix prefix, String taskName, Instant firstLogTime, String agentId, byte[] gzData)
    {
        String dateDir = LogFiles.formatDataDir(prefix);
        String attemptDir = LogFiles.formatSessionAttemptDir(prefix);
        String fileName = LogFiles.formatFileName(taskName, firstLogTime, agentId);

        putFile(dateDir, attemptDir, fileName, gzData);

        return fileName;
    }

    @Override
    public byte[] getFile(LogFilePrefix prefix, String fileName)
            throws StorageFileNotFoundException
    {
        String dateDir = LogFiles.formatDataDir(prefix);
        String attemptDir = LogFiles.formatSessionAttemptDir(prefix);
        return getFile(dateDir, attemptDir, fileName);
    }

    @Override
    public List<LogFileHandle> getFileHandles(LogFilePrefix prefix, Optional<String> taskName, boolean enableDirectDownload)
    {
        String dateDir = LogFiles.formatDataDir(prefix);
        String attemptDir = LogFiles.formatSessionAttemptDir(prefix);

        List<LogFileHandle> handles = new ArrayList<>();

        listFiles(dateDir, attemptDir, enableDirectDownload, (name, size, direct) -> {
            if (name.endsWith(LogFiles.LOG_GZ_FILE_SUFFIX) && (!taskName.isPresent() || name.startsWith(taskName.get()))) {
                LogFileHandle handle = LogFiles.buildLogFileHandleFromFileName(name, size);
                if (handle != null) {
                    if (direct != null) {
                        handles.add(
                                ImmutableLogFileHandle.builder()
                                .from(handle)
                                .direct(Optional.of(direct))
                                .build());
                    }
                    else {
                        handles.add(handle);
                    }
                }
            }
        });

        LogFiles.sortLogFileHandles(handles);

        return handles;
    }
}


text:
package com.example.android.miwok;

import android.media.MediaPlayer;
import android.widget.ImageView;

/**
 * Created by mohamed on 7/18/2017.
 */

public class Word {

    // the audio file
    private int maudio;

    // default translation for the word
    private String mdefaultTranslation;

    // Miwok translation for the word
    private String mmiwokTranslation;

    // image for each list item view (m is for member variable)
// if there is an image, the mImage will be changed to (R.id.source)
    // if there is no image it will stay = -1
    private int mImage = mnoImageFound;

    private static final int mnoImageFound = -1;

    public Word(String defaultTranslation, String miwokTranslation, int image, int audio) {
        this.mdefaultTranslation = defaultTranslation;
        this.mmiwokTranslation = miwokTranslation;
        this.maudio = audio;

        // mImage value will change
        this.mImage = image;

    }

    //constructor for the phrase activity (Without images)
    public Word(String mdefaultTranslation, String mmiwokTranslation,int audio) {

        this.mdefaultTranslation = mdefaultTranslation;
        this.mmiwokTranslation = mmiwokTranslation;
        this.maudio = audio;

    }

    // get the audio
    public int  getAudio() {

        return maudio;

    }

    // get default translation
    public String getDefaultTranslation() {
        return mdefaultTranslation;
    }

    // get Miwok translation
    public String getMiwokTranslation() {
        return mmiwokTranslation;
    }

    // get the image
    public int getimage() {
        return mImage;
    }

    public boolean getImageResult() {
// this should return true in case of there is an image
        return mImage != mnoImageFound;

    }

    @Override
    public String toString() {
        return "Word{" +
                "maudio=" + maudio +
                ", mdefaultTranslation='" + mdefaultTranslation + '\'' +
                ", mmiwokTranslation='" + mmiwokTranslation + '\'' +
                ", mImage=" + mImage +
                '}';
    }
}


text:
/*
 * Copyright 2013-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 *
 * http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.health.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Summary information about an event, returned by the DescribeEvents operation. The DescribeEventDetails
 * operation also returns this information, as well as the EventDescription and additional event metadata.
 *

 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Event implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The unique identifier for the event. Format:
     * arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     * arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     *

     */
    private String arn;
    /**
     *

     * The AWS service that is affected by the event. For example, EC2, RDS.
     *

     */
    private String service;
    /**
     *

     * The unique identifier for the event type. The format is AWS_SERVICE_DESCRIPTION ; for
     * example, AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     *

     */
    private String eventTypeCode;
    /**
     *

     * The
     *

     */
    private String eventTypeCategory;
    /**
     *

     * The AWS region name of the event.
     *

     */
    private String region;
    /**
     *

     * The AWS Availability Zone of the event. For example, us-east-1a.
     *

     */
    private String availabilityZone;
    /**
     *

     * The date and time that the event began.
     *

     */
    private java.util.Date startTime;
    /**
     *

     * The date and time that the event ended.
     *

     */
    private java.util.Date endTime;
    /**
     *

     * The most recent date and time that the event was updated.
     *

     */
    private java.util.Date lastUpdatedTime;
    /**
     *

     * The most recent status of the event. Possible values are open, closed, and
     * upcoming.
     *

     */
    private String statusCode;

    /**
     *

     * The unique identifier for the event. Format:
     * arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     * arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     *

     *
     * @param arn
     *        The unique identifier for the event. Format:
     *        arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     *        arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     */

    public void setArn(String arn) {
        this.arn = arn;
    }

    /**
     *

     * The unique identifier for the event. Format:
     * arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     * arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     *

     *
     * @return The unique identifier for the event. Format:
     *         arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     *         arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     */

    public String getArn() {
        return this.arn;
    }

    /**
     *

     * The unique identifier for the event. Format:
     * arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     * arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     *

     *
     * @param arn
     *        The unique identifier for the event. Format:
     *        arn:aws:health:event-region::event/EVENT_TYPE_PLUS_ID . Example:
     *        arn:aws:health:us-east-1::event/AWS_EC2_MAINTENANCE_5331
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withArn(String arn) {
        setArn(arn);
        return this;
    }

    /**
     *

     * The AWS service that is affected by the event. For example, EC2, RDS.
     *

     *
     * @param service
     *        The AWS service that is affected by the event. For example, EC2, RDS.
     */

    public void setService(String service) {
        this.service = service;
    }

    /**
     *

     * The AWS service that is affected by the event. For example, EC2, RDS.
     *

     *
     * @return The AWS service that is affected by the event. For example, EC2, RDS.
     */

    public String getService() {
        return this.service;
    }

    /**
     *

     * The AWS service that is affected by the event. For example, EC2, RDS.
     *

     *
     * @param service
     *        The AWS service that is affected by the event. For example, EC2, RDS.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withService(String service) {
        setService(service);
        return this;
    }

    /**
     *

     * The unique identifier for the event type. The format is AWS_SERVICE_DESCRIPTION ; for
     * example, AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     *

     *
     * @param eventTypeCode
     *        The unique identifier for the event type. The format is
     *        AWS_SERVICE_DESCRIPTION ; for example,
     *        AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     */

    public void setEventTypeCode(String eventTypeCode) {
        this.eventTypeCode = eventTypeCode;
    }

    /**
     *

     * The unique identifier for the event type. The format is AWS_SERVICE_DESCRIPTION ; for
     * example, AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     *

     *
     * @return The unique identifier for the event type. The format is
     *         AWS_SERVICE_DESCRIPTION ; for example,
     *         AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     */

    public String getEventTypeCode() {
        return this.eventTypeCode;
    }

    /**
     *

     * The unique identifier for the event type. The format is AWS_SERVICE_DESCRIPTION ; for
     * example, AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     *

     *
     * @param eventTypeCode
     *        The unique identifier for the event type. The format is
     *        AWS_SERVICE_DESCRIPTION ; for example,
     *        AWS_EC2_SYSTEM_MAINTENANCE_EVENT.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withEventTypeCode(String eventTypeCode) {
        setEventTypeCode(eventTypeCode);
        return this;
    }

    /**
     *

     * The
     *

     *
     * @param eventTypeCategory
     *        The
     * @see EventTypeCategory
     */

    public void setEventTypeCategory(String eventTypeCategory) {
        this.eventTypeCategory = eventTypeCategory;
    }

    /**
     *

     * The
     *

     *
     * @return The
     * @see EventTypeCategory
     */

    public String getEventTypeCategory() {
        return this.eventTypeCategory;
    }

    /**
     *

     * The
     *

     *
     * @param eventTypeCategory
     *        The
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see EventTypeCategory
     */

    public Event withEventTypeCategory(String eventTypeCategory) {
        setEventTypeCategory(eventTypeCategory);
        return this;
    }

    /**
     *

     * The
     *

     *
     * @param eventTypeCategory
     *        The
     * @see EventTypeCategory
     */

    public void setEventTypeCategory(EventTypeCategory eventTypeCategory) {
        withEventTypeCategory(eventTypeCategory);
    }

    /**
     *

     * The
     *

     *
     * @param eventTypeCategory
     *        The
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see EventTypeCategory
     */

    public Event withEventTypeCategory(EventTypeCategory eventTypeCategory) {
        this.eventTypeCategory = eventTypeCategory.toString();
        return this;
    }

    /**
     *

     * The AWS region name of the event.
     *

     *
     * @param region
     *        The AWS region name of the event.
     */

    public void setRegion(String region) {
        this.region = region;
    }

    /**
     *

     * The AWS region name of the event.
     *

     *
     * @return The AWS region name of the event.
     */

    public String getRegion() {
        return this.region;
    }

    /**
     *

     * The AWS region name of the event.
     *

     *
     * @param region
     *        The AWS region name of the event.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withRegion(String region) {
        setRegion(region);
        return this;
    }

    /**
     *

     * The AWS Availability Zone of the event. For example, us-east-1a.
     *

     *
     * @param availabilityZone
     *        The AWS Availability Zone of the event. For example, us-east-1a.
     */

    public void setAvailabilityZone(String availabilityZone) {
        this.availabilityZone = availabilityZone;
    }

    /**
     *

     * The AWS Availability Zone of the event. For example, us-east-1a.
     *

     *
     * @return The AWS Availability Zone of the event. For example, us-east-1a.
     */

    public String getAvailabilityZone() {
        return this.availabilityZone;
    }

    /**
     *

     * The AWS Availability Zone of the event. For example, us-east-1a.
     *

     *
     * @param availabilityZone
     *        The AWS Availability Zone of the event. For example, us-east-1a.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withAvailabilityZone(String availabilityZone) {
        setAvailabilityZone(availabilityZone);
        return this;
    }

    /**
     *

     * The date and time that the event began.
     *

     *
     * @param startTime
     *        The date and time that the event began.
     */

    public void setStartTime(java.util.Date startTime) {
        this.startTime = startTime;
    }

    /**
     *

     * The date and time that the event began.
     *

     *
     * @return The date and time that the event began.
     */

    public java.util.Date getStartTime() {
        return this.startTime;
    }

    /**
     *

     * The date and time that the event began.
     *

     *
     * @param startTime
     *        The date and time that the event began.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withStartTime(java.util.Date startTime) {
        setStartTime(startTime);
        return this;
    }

    /**
     *

     * The date and time that the event ended.
     *

     *
     * @param endTime
     *        The date and time that the event ended.
     */

    public void setEndTime(java.util.Date endTime) {
        this.endTime = endTime;
    }

    /**
     *

     * The date and time that the event ended.
     *

     *
     * @return The date and time that the event ended.
     */

    public java.util.Date getEndTime() {
        return this.endTime;
    }

    /**
     *

     * The date and time that the event ended.
     *

     *
     * @param endTime
     *        The date and time that the event ended.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withEndTime(java.util.Date endTime) {
        setEndTime(endTime);
        return this;
    }

    /**
     *

     * The most recent date and time that the event was updated.
     *

     *
     * @param lastUpdatedTime
     *        The most recent date and time that the event was updated.
     */

    public void setLastUpdatedTime(java.util.Date lastUpdatedTime) {
        this.lastUpdatedTime = lastUpdatedTime;
    }

    /**
     *

     * The most recent date and time that the event was updated.
     *

     *
     * @return The most recent date and time that the event was updated.
     */

    public java.util.Date getLastUpdatedTime() {
        return this.lastUpdatedTime;
    }

    /**
     *

     * The most recent date and time that the event was updated.
     *

     *
     * @param lastUpdatedTime
     *        The most recent date and time that the event was updated.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public Event withLastUpdatedTime(java.util.Date lastUpdatedTime) {
        setLastUpdatedTime(lastUpdatedTime);
        return this;
    }

    /**
     *

     * The most recent status of the event. Possible values are open, closed, and
     * upcoming.
     *

     *
     * @param statusCode
     *        The most recent status of the event. Possible values are open, closed, and
     *        upcoming.
     * @see EventStatusCode
     */

    public void setStatusCode(String statusCode) {
        this.statusCode = statusCode;
    }

    /**
     *

     * The most recent status of the event. Possible values are open, closed, and
     * upcoming.
     *

     *
     * @return The most recent status of the event. Possible values are open, closed, and
     *         upcoming.
     * @see EventStatusCode
     */

    public String getStatusCode() {
        return this.statusCode;
    }

    /**
     *

     * The most recent status of the event. Possible values are open, closed, and
     * upcoming.
     *

     *
     * @param statusCode
     *        The most recent status of the event. Possible values are open, closed, and
     *        upcoming.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see EventStatusCode
     */

    public Event withStatusCode(String statusCode) {
        setStatusCode(statusCode);
        return this;
    }

    /**
     *

     * The most recent status of the event. Possible values are open, closed, and
     * upcoming.
     *

     *
     * @param statusCode
     *        The most recent status of the event. Possible values are open, closed, and
     *        upcoming.
     * @see EventStatusCode
     */

    public void setStatusCode(EventStatusCode statusCode) {
        withStatusCode(statusCode);
    }

    /**
     *

     * The most recent status of the event. Possible values are open, closed, and
     * upcoming.
     *

     *
     * @param statusCode
     *        The most recent status of the event. Possible values are open, closed, and
     *        upcoming.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see EventStatusCode
     */

    public Event withStatusCode(EventStatusCode statusCode) {
        this.statusCode = statusCode.toString();
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getArn() != null)
            sb.append("Arn: ").append(getArn()).append(",");
        if (getService() != null)
            sb.append("Service: ").append(getService()).append(",");
        if (getEventTypeCode() != null)
            sb.append("EventTypeCode: ").append(getEventTypeCode()).append(",");
        if (getEventTypeCategory() != null)
            sb.append("EventTypeCategory: ").append(getEventTypeCategory()).append(",");
        if (getRegion() != null)
            sb.append("Region: ").append(getRegion()).append(",");
        if (getAvailabilityZone() != null)
            sb.append("AvailabilityZone: ").append(getAvailabilityZone()).append(",");
        if (getStartTime() != null)
            sb.append("StartTime: ").append(getStartTime()).append(",");
        if (getEndTime() != null)
            sb.append("EndTime: ").append(getEndTime()).append(",");
        if (getLastUpdatedTime() != null)
            sb.append("LastUpdatedTime: ").append(getLastUpdatedTime()).append(",");
        if (getStatusCode() != null)
            sb.append("StatusCode: ").append(getStatusCode());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof Event == false)
            return false;
        Event other = (Event) obj;
        if (other.getArn() == null ^ this.getArn() == null)
            return false;
        if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
            return false;
        if (other.getService() == null ^ this.getService() == null)
            return false;
        if (other.getService() != null && other.getService().equals(this.getService()) == false)
            return false;
        if (other.getEventTypeCode() == null ^ this.getEventTypeCode() == null)
            return false;
        if (other.getEventTypeCode() != null && other.getEventTypeCode().equals(this.getEventTypeCode()) == false)
            return false;
        if (other.getEventTypeCategory() == null ^ this.getEventTypeCategory() == null)
            return false;
        if (other.getEventTypeCategory() != null && other.getEventTypeCategory().equals(this.getEventTypeCategory()) == false)
            return false;
        if (other.getRegion() == null ^ this.getRegion() == null)
            return false;
        if (other.getRegion() != null && other.getRegion().equals(this.getRegion()) == false)
            return false;
        if (other.getAvailabilityZone() == null ^ this.getAvailabilityZone() == null)
            return false;
        if (other.getAvailabilityZone() != null && other.getAvailabilityZone().equals(this.getAvailabilityZone()) == false)
            return false;
        if (other.getStartTime() == null ^ this.getStartTime() == null)


text:
/*================================================================================
Copyright (c) 2013 Steve Jin. All Rights Reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of VMware, Inc. nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/

package com.vmware.vim25;

/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/

@SuppressWarnings("all")
public class HostVFlashManagerVFlashCacheConfigSpec extends DynamicData {
  public String defaultVFlashModule;
  public long swapCacheReservationInGB;

  public String getDefaultVFlashModule() {
    return this.defaultVFlashModule;
  }

  public long getSwapCacheReservationInGB() {
    return this.swapCacheReservationInGB;
  }

  public void setDefaultVFlashModule(String defaultVFlashModule) {
    this.defaultVFlashModule=defaultVFlashModule;
  }

  public void setSwapCacheReservationInGB(long swapCacheReservationInGB) {
    this.swapCacheReservationInGB=swapCacheReservationInGB;
  }
}


text:
/*
 * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
 *
 * This software is open source.
 * See the bottom of this file for the licence.
 */

package org.dom4j.datatype;

import com.sun.msv.datatype.DatabindableDatatype;
import com.sun.msv.datatype.SerializationContext;
import com.sun.msv.datatype.xsd.XSDatatype;

import org.dom4j.Element;
import org.dom4j.Namespace;
import org.dom4j.QName;
import org.dom4j.tree.AbstractAttribute;

import org.relaxng.datatype.DatatypeException;
import org.relaxng.datatype.ValidationContext;

/**
 *

 * DatatypeAttribute represents an Attribute which supports the
 * XML Schema Data Types
 * specification.
 *

 *
 * @author James Strachan
 * @version $Revision: 1.9 $
 */
public class DatatypeAttribute extends AbstractAttribute implements
        SerializationContext, ValidationContext {
    /** The parent Element of the Attribute */
    private Element parent;

    /** The QName for this element */
    private QName qname;

    /** The XSDatatype of the Attribute */
    private XSDatatype datatype;

    /** The data (Object) value of the Attribute */
    private Object data;

    /** The text value of the Attribute */
    private String text;

    public DatatypeAttribute(QName qname, XSDatatype datatype) {
        this.qname = qname;
        this.datatype = datatype;
    }

    public DatatypeAttribute(QName qname, XSDatatype datatype, String text) {
        this.qname = qname;
        this.datatype = datatype;
        this.text = text;
        this.data = convertToValue(text);
    }

    public String toString() {
        return getClass().getName() + hashCode() + " [Attribute: name "
                + getQualifiedName() + " value \"" + getValue() + "\" data: "
                + getData() + "]";
    }

    /**
     * Returns the MSV XSDatatype for this node
     *
     * @return DOCUMENT ME!
     */
    public XSDatatype getXSDatatype() {
        return datatype;
    }

    // SerializationContext interface
    // -------------------------------------------------------------------------
    public String getNamespacePrefix(String uri) {
        Element parentElement = getParent();

        if (parentElement != null) {
            Namespace namespace = parentElement.getNamespaceForURI(uri);

            if (namespace != null) {
                return namespace.getPrefix();
            }
        }

        return null;
    }

    // ValidationContext interface
    // -------------------------------------------------------------------------
    public String getBaseUri() {
        // XXXX: could we use a Document for this?
        return null;
    }

    public boolean isNotation(String notationName) {
        // XXXX: no way to do this yet in dom4j so assume false
        return false;
    }

    public boolean isUnparsedEntity(String entityName) {
        // XXXX: no way to do this yet in dom4j so assume valid
        return true;
    }

    public String resolveNamespacePrefix(String prefix) {
        // first lets see if this is our attribute's prefix
        if (prefix.equals(getNamespacePrefix())) {
            return getNamespaceURI();
        } else {
            Element parentElement = getParent();

            if (parentElement != null) {
                Namespace namespace = parentElement
                        .getNamespaceForPrefix(prefix);

                if (namespace != null) {
                    return namespace.getURI();
                }
            }
        }

        return null;
    }

    // Attribute interface
    // -------------------------------------------------------------------------
    public QName getQName() {
        return qname;
    }

    public String getValue() {
        return text;
    }

    public void setValue(String value) {
        validate(value);

        this.text = value;
        this.data = convertToValue(value);
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        String s = datatype.convertToLexicalValue(data, this);
        validate(s);
        this.text = s;
        this.data = data;
    }

    public Element getParent() {
        return parent;
    }

    public void setParent(Element parent) {
        this.parent = parent;
    }

    public boolean supportsParent() {
        return true;
    }

    public boolean isReadOnly() {
        return false;
    }

    // Implementation methods
    // -------------------------------------------------------------------------
    protected void validate(String txt) throws IllegalArgumentException {
        try {
            datatype.checkValid(txt, this);
        } catch (DatatypeException e) {
            throw new IllegalArgumentException(e.getMessage());
        }
    }

    protected Object convertToValue(String txt) {
        if (datatype instanceof DatabindableDatatype) {
            DatabindableDatatype bindable = (DatabindableDatatype) datatype;

            return bindable.createJavaObject(txt, this);
        } else {
            return datatype.createValue(txt, this);
        }
    }
}

/*
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided that the
 * following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright statements and
 * notices. Redistributions must also contain a copy of this document.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * 3. The name "DOM4J" must not be used to endorse or promote products derived
 * from this Software without prior written permission of MetaStuff, Ltd. For
 * written permission, please contact dom4j-info@metastuff.com.
 *
 * 4. Products derived from this Software may not be called "DOM4J" nor may
 * "DOM4J" appear in their names without prior written permission of MetaStuff,
 * Ltd. DOM4J is a registered trademark of MetaStuff, Ltd.
 *
 * 5. Due credit should be given to the DOM4J Project - http://www.dom4j.org
 *
 * THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL METASTUFF, LTD. OR ITS CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
 */