hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 1
value | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 5
1.02k
| max_stars_repo_name
stringlengths 4
126
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
list | max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 5
1.02k
| max_issues_repo_name
stringlengths 4
114
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
list | max_issues_count
float64 1
92.2k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 5
1.02k
| max_forks_repo_name
stringlengths 4
136
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
list | max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | avg_line_length
float64 2.55
99.9
| max_line_length
int64 3
1k
| alphanum_fraction
float64 0.25
1
| index
int64 0
1M
| content
stringlengths 3
1.05M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e07241a480c2e43c0fabcbc0f30f5c18d19a66e
| 3,290 |
java
|
Java
|
app/src/main/java/com/codepath/apps/simpletweets/adapters/TweetsAdapter.java
|
shankar8353/SimpleTweets
|
a1e3b1ed37777f600753080939c21918f2620b12
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/codepath/apps/simpletweets/adapters/TweetsAdapter.java
|
shankar8353/SimpleTweets
|
a1e3b1ed37777f600753080939c21918f2620b12
|
[
"Apache-2.0"
] | 2 |
2016-06-07T04:36:57.000Z
|
2016-06-14T15:41:42.000Z
|
app/src/main/java/com/codepath/apps/simpletweets/adapters/TweetsAdapter.java
|
shankar8353/SimpleTweets
|
a1e3b1ed37777f600753080939c21918f2620b12
|
[
"Apache-2.0"
] | null | null | null | 33.232323 | 118 | 0.670213 | 3,018 |
package com.codepath.apps.simpletweets.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.codepath.apps.simpletweets.R;
import com.codepath.apps.simpletweets.models.Tweet;
import com.squareup.picasso.Picasso;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by ssunda1 on 6/4/16.
*/
public class TweetsAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private List<Tweet> tweets;
private OnItemClickListener listener;
public TweetsAdapter(List<Tweet> tweets) {
this.tweets = tweets;
}
public void setOnItemClickListener(OnItemClickListener listener) {
this.listener = listener;
}
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
Context context = parent.getContext();
LayoutInflater inflater = LayoutInflater.from(context);
// Inflate the custom layout
RecyclerView.ViewHolder holder;
View view = inflater.inflate(R.layout.item_tweet, parent, false);
holder = new ViewHolder(view, listener);
return holder;
}
@Override
public void onBindViewHolder(RecyclerView.ViewHolder rvHolder, int position) {
Tweet tweet = tweets.get(position);
ViewHolder holder = (ViewHolder) rvHolder;
holder.tvUser.setText(tweet.getUser().getName());
holder.tvScreenName.setText("@" + tweet.getUser().getScreenName());
holder.tvRelTime.setText(tweet.getRelativeTimeAgo());
holder.tvText.setText(tweet.getBody());
Picasso.with(holder.ivProfile.getContext()).load(tweet.getUser().getProfileImageUrl()).into(holder.ivProfile);
}
@Override
public int getItemCount() {
return tweets.size();
}
public static class ViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.ivComposeProfile) ImageView ivProfile;
@BindView(R.id.tvComposeUser) TextView tvUser;
@BindView(R.id.tvComposeScreenName) TextView tvScreenName;
@BindView(R.id.tvRelTime) TextView tvRelTime;
@BindView(R.id.tvText) TextView tvText;
public ViewHolder(final View view, final OnItemClickListener listener) {
super(view);
ButterKnife.bind(this, view);
if (listener != null) {
setListener(view, listener);
setListener(ivProfile, listener);
setListener(tvUser, listener);
setListener(tvScreenName, listener);
setListener(tvRelTime, listener);
setListener(tvText, listener);
}
}
private void setListener(View view, final OnItemClickListener listener) {
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
listener.onItemClick(v, getLayoutPosition());
}
});
}
}
public interface OnItemClickListener {
void onItemClick(View itemView, int position);
}
}
|
3e0724769d1f22256ed4311dea424e1f33e2f9d9
| 376 |
java
|
Java
|
gulimall-order/src/main/java/com/atguigu/gulimall/order/dao/RefundInfoDao.java
|
iio97/gulimall
|
443f677dd6282150b9d7e32f55fd620e9ce32f38
|
[
"Apache-2.0"
] | null | null | null |
gulimall-order/src/main/java/com/atguigu/gulimall/order/dao/RefundInfoDao.java
|
iio97/gulimall
|
443f677dd6282150b9d7e32f55fd620e9ce32f38
|
[
"Apache-2.0"
] | null | null | null |
gulimall-order/src/main/java/com/atguigu/gulimall/order/dao/RefundInfoDao.java
|
iio97/gulimall
|
443f677dd6282150b9d7e32f55fd620e9ce32f38
|
[
"Apache-2.0"
] | null | null | null | 20.833333 | 69 | 0.765333 | 3,019 |
package com.atguigu.gulimall.order.dao;
import com.atguigu.gulimall.order.entity.RefundInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* 退款信息
*
* @author zlq
* @email [email protected]
* @date 2020-09-19 22:42:40
*/
@Mapper
public interface RefundInfoDao extends BaseMapper<RefundInfoEntity> {
}
|
3e072589e51f91675faf6b5212b87497bb180e06
| 2,419 |
java
|
Java
|
Java/740.java
|
vindhya2g/LeetCode
|
73790d44605fbd51e8f7e804b9808e364fcfc680
|
[
"MIT"
] | 854 |
2018-11-09T08:06:16.000Z
|
2022-03-31T06:05:53.000Z
|
Java/740.java
|
vindhya2g/LeetCode
|
73790d44605fbd51e8f7e804b9808e364fcfc680
|
[
"MIT"
] | 29 |
2019-06-02T05:02:25.000Z
|
2021-11-15T04:09:37.000Z
|
Java/740.java
|
vindhya2g/LeetCode
|
73790d44605fbd51e8f7e804b9808e364fcfc680
|
[
"MIT"
] | 347 |
2018-12-23T01:57:37.000Z
|
2022-03-12T14:51:21.000Z
| 35.573529 | 98 | 0.547334 | 3,020 |
__________________________________________________________________________________________________
sample 1 ms submission
class Solution {
public int deleteAndEarn(int[] nums) {
int[] count = new int[10001];
for (int x: nums) count[x]++;
int avoid = 0, using = 0, prev = -1;
for (int k = 0; k <= 10000; ++k) if (count[k] > 0) {
int m = Math.max(avoid, using);
if (k - 1 != prev) {
using = k * count[k] + m;
avoid = m;
} else {
using = k * count[k] + avoid;
avoid = m;
}
prev = k;
}
return Math.max(avoid, using);
}
}
__________________________________________________________________________________________________
sample 34680 kb submission
class Solution {
public int deleteAndEarn(int[] nums) {
Map<Integer, Integer> numToSum = new HashMap<>();
for (int num : nums) {
numToSum.put(num, numToSum.getOrDefault(num, 0) + num);
}
List<Map.Entry<Integer, Integer>> list = new ArrayList<>(numToSum.entrySet());
list.sort((e1, e2) -> e2.getKey() - e1.getKey());
int[] dp = new int[list.size()];
return helper(list, 0, dp);
}
private int helper(List<Map.Entry<Integer, Integer>> list, int idx, int[] dp) {
if (idx == list.size() - 1) {
// this is the end of the list and it's valid to take it based on our logic
return list.get(idx).getValue();
}
if (idx >= list.size()) {
return 0;
}
if (dp[idx] != 0) {
return dp[idx];
}
Map.Entry<Integer, Integer> cur = list.get(idx);
// option 1: take it
int sum1;
Map.Entry<Integer, Integer> next = list.get(idx + 1);
if (cur.getKey() == next.getKey() + 1) {
// we cannot take the next one
sum1 = cur.getValue() + helper(list, idx + 2, dp);
} else {
// we can take next because it will not be deleted
sum1 = cur.getValue() + helper(list, idx + 1, dp);
}
// option 2: not taking it
int sum2 = helper(list, idx + 1, dp);
int max = Math.max(sum1, sum2);
dp[idx] = max;
return max;
}
}
__________________________________________________________________________________________________
|
3e0727a258a60ba9645894ca3da76ca49477f470
| 364 |
java
|
Java
|
allsrc/com/sina/sso/RemoteSSO.java
|
clilystudio/NetBook
|
a8ca6cb91e9259ed7dec70b830829d622525b4b7
|
[
"Unlicense"
] | 1 |
2018-02-04T12:23:55.000Z
|
2018-02-04T12:23:55.000Z
|
allsrc/com/sina/sso/RemoteSSO.java
|
clilystudio/NetBook
|
a8ca6cb91e9259ed7dec70b830829d622525b4b7
|
[
"Unlicense"
] | null | null | null |
allsrc/com/sina/sso/RemoteSSO.java
|
clilystudio/NetBook
|
a8ca6cb91e9259ed7dec70b830829d622525b4b7
|
[
"Unlicense"
] | null | null | null | 24.266667 | 83 | 0.730769 | 3,021 |
package com.sina.sso;
import android.os.IInterface;
public abstract interface RemoteSSO extends IInterface
{
public abstract String getActivityName();
public abstract String getPackageName();
}
/* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar
* Qualified Name: com.sina.sso.RemoteSSO
* JD-Core Version: 0.6.0
*/
|
3e07280c9928e7e416b4071367739a61c2a39312
| 386 |
java
|
Java
|
app/src/main/java/com/ljmu/andre/snaptools/EventBus/Events/LoadPackSettingsEvent.java
|
tardeaux/SnapTools
|
899f8f2d4ce1d840ae537bd16b8da98b8180aeeb
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/ljmu/andre/snaptools/EventBus/Events/LoadPackSettingsEvent.java
|
tardeaux/SnapTools
|
899f8f2d4ce1d840ae537bd16b8da98b8180aeeb
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/ljmu/andre/snaptools/EventBus/Events/LoadPackSettingsEvent.java
|
tardeaux/SnapTools
|
899f8f2d4ce1d840ae537bd16b8da98b8180aeeb
|
[
"Apache-2.0"
] | null | null | null | 20.315789 | 52 | 0.681347 | 3,022 |
package com.ljmu.andre.snaptools.EventBus.Events;
/**
* This class was created by Andre R M (SID: 701439)
* It and its contents are free to use by all
*/
public class LoadPackSettingsEvent {
private String packName;
public LoadPackSettingsEvent(String packName) {
this.packName = packName;
}
public String getPackName() {
return packName;
}
}
|
3e07291e5a2cdd664ea8458f2b328c4c1ac12bbf
| 313 |
java
|
Java
|
model/src/main/java/pl/cwanix/opensun/model/character/InventoryModel.java
|
CwaniX/Open-SUN-Emu
|
00eea3963795fead3ec1de7e977a63ff6a4ce8e2
|
[
"MIT"
] | 10 |
2019-10-17T16:58:25.000Z
|
2021-07-16T16:58:07.000Z
|
model/src/main/java/pl/cwanix/opensun/model/character/InventoryModel.java
|
CwaniX/Open-SUN-Emu
|
00eea3963795fead3ec1de7e977a63ff6a4ce8e2
|
[
"MIT"
] | 14 |
2019-07-05T08:10:20.000Z
|
2019-08-16T11:22:59.000Z
|
model/src/main/java/pl/cwanix/opensun/model/character/InventoryModel.java
|
CwaniX/Open-SUN-Emu
|
00eea3963795fead3ec1de7e977a63ff6a4ce8e2
|
[
"MIT"
] | 9 |
2020-04-24T13:22:10.000Z
|
2021-07-16T16:58:10.000Z
| 18.411765 | 42 | 0.734824 | 3,023 |
package pl.cwanix.opensun.model.character;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class InventoryModel {
private int id;
private int money;
private int inventoryLock;
private byte[] inventoryItem;
private byte[] tmpInventoryItem;
private byte[] equipItem;
}
|
3e0729b7268412e48c561dc0f7ca4dd50a0e0f30
| 5,052 |
java
|
Java
|
cyclop-webapp/src/main/java/org/cyclop/model/CqlCompletion.java
|
maciejmiklas/cyclop
|
741a117ec154cb8882b44bc4d624ce6ea40dae6f
|
[
"Apache-2.0"
] | 23 |
2015-04-28T16:08:26.000Z
|
2020-05-13T07:48:41.000Z
|
cyclop-webapp/src/main/java/org/cyclop/model/CqlCompletion.java
|
maciejmiklas/cyclop
|
741a117ec154cb8882b44bc4d624ce6ea40dae6f
|
[
"Apache-2.0"
] | 5 |
2015-01-12T13:15:19.000Z
|
2016-10-27T01:01:49.000Z
|
cyclop-webapp/src/main/java/org/cyclop/model/CqlCompletion.java
|
maciejmiklas/cyclop
|
741a117ec154cb8882b44bc4d624ce6ea40dae6f
|
[
"Apache-2.0"
] | 12 |
2015-02-19T18:08:23.000Z
|
2021-12-26T14:44:44.000Z
| 26.3125 | 106 | 0.720507 | 3,024 |
/*
* 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.cyclop.model;
import java.io.Serializable;
import java.util.Collection;
import java.util.Objects;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import net.jcip.annotations.Immutable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSortedSet;
/** @author Maciej Miklas */
@Immutable
public final class CqlCompletion implements Serializable {
private final static Logger LOG = LoggerFactory.getLogger(CqlCompletion.class);
private final static ImmutableList<String> VALUE_PREF = ImmutableList.of("'", "(", ",", ":");
/**
* used during typing, contains all possible combinations that will be suggested when pressing TAB
*/
@NotNull
@Valid
public final ImmutableSortedSet<? extends CqlPart> fullCompletion;
/** used for hint window */
@NotNull
@Valid
public final ImmutableSortedSet<? extends CqlPart> minCompletion;
CqlCompletion(ImmutableSortedSet<? extends CqlPart> fullCompletion,
ImmutableSortedSet<? extends CqlPart> minCompletion) {
this.fullCompletion = fullCompletion;
this.minCompletion = minCompletion;
}
private CqlCompletion() {
this.fullCompletion = ImmutableSortedSet.of();
this.minCompletion = ImmutableSortedSet.of();
}
@Override
public String toString() {
return "CqlCompletion{" + "fullCompletion=" + fullCompletion + ", minCompletion=" + minCompletion + '}';
}
@Override
public int hashCode() {
return Objects.hash(fullCompletion);
}
@Override
public boolean equals(Object obj) {
if (obj == null || getClass() != obj.getClass()) {
return false;
}
final CqlCompletion other = (CqlCompletion) obj;
return Objects.equals(fullCompletion, other.fullCompletion);
}
public boolean isEmpty() {
return fullCompletion.isEmpty();
}
/** @author Maciej Miklas */
public static class Builder {
private final static CqlCompletion EMPTY = new CqlCompletion();
private ImmutableSortedSet.Builder<CqlPart> full = ImmutableSortedSet.naturalOrder();
private ImmutableSortedSet.Builder<CqlPart> min = ImmutableSortedSet.naturalOrder();
public static Builder naturalOrder() {
return new Builder();
}
public static CqlCompletion empty() {
return EMPTY;
}
public Builder full(Collection<? extends CqlPart> part) {
full.addAll(part);
return this;
}
public Builder min(Collection<? extends CqlPart> part) {
min.addAll(part);
return this;
}
public Builder all(Collection<? extends CqlPart> part) {
min.addAll(part);
full.addAll(part);
return this;
}
public Builder full(CqlPart part) {
full.add(part);
return this;
}
public Builder min(CqlPart part) {
min.add(part);
return this;
}
public Builder all(CqlPart part) {
min.add(part);
full.add(part);
return this;
}
public Builder prefix(CqlPart part) {
VALUE_PREF.stream().forEach(pref -> prefix(pref, part));
return this;
}
private Builder prefix(String prefix, CqlPart part) {
min.add(part);
full.add(part);
CqlPart prefixPart = new CqlPart(prefix + part.toDisplayString());
full.add(prefixPart);
return this;
}
private Builder prefix(String prefix, Collection<? extends CqlPart> col) {
col.stream().forEach(part -> prefix(prefix, part));
return this;
}
public Builder value(Collection<? extends CqlPart> col) {
VALUE_PREF.stream().forEach(pref -> prefix(pref, col));
return this;
}
public BuilderTemplate template() {
return new BuilderTemplate(min.build(), full.build());
}
public CqlCompletion build() {
CqlCompletion comp = new CqlCompletion(full.build(), min.build());
LOG.trace("Build completion: {}", comp);
return comp;
}
}
public final static class BuilderTemplate {
private ImmutableSortedSet<CqlPart> full;
private ImmutableSortedSet<CqlPart> min;
public BuilderTemplate(ImmutableSortedSet<CqlPart> min, ImmutableSortedSet<CqlPart> full) {
this.full = full;
this.min = min;
}
public Builder naturalOrder() {
return Builder.naturalOrder().full(full).min(min);
}
@Override
public String toString() {
return "BuilderTemplate{" + "full=" + full + ", min=" + min + '}';
}
}
}
|
3e072a0e444c5cbe7b7aa91da5e8e7cb7ecb8b83
| 12,588 |
java
|
Java
|
src/main/java/urn/ietf/params/xml/ns/yang/nfvo/vnfd/rev150910/vnfd/descriptor/MgmtInterfaceBuilder.java
|
ctranoris/eu.5ginFIRE.riftioyangschema2java
|
46a0fe252fc72551dc52f1e23b115907fceb49fe
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/urn/ietf/params/xml/ns/yang/nfvo/vnfd/rev150910/vnfd/descriptor/MgmtInterfaceBuilder.java
|
ctranoris/eu.5ginFIRE.riftioyangschema2java
|
46a0fe252fc72551dc52f1e23b115907fceb49fe
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/urn/ietf/params/xml/ns/yang/nfvo/vnfd/rev150910/vnfd/descriptor/MgmtInterfaceBuilder.java
|
ctranoris/eu.5ginFIRE.riftioyangschema2java
|
46a0fe252fc72551dc52f1e23b115907fceb49fe
|
[
"Apache-2.0"
] | 1 |
2017-08-22T15:35:13.000Z
|
2017-08-22T15:35:13.000Z
| 42.816327 | 301 | 0.615904 | 3,025 |
package urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.opendaylight.yangtools.concepts.Builder;
import org.opendaylight.yangtools.yang.binding.Augmentation;
import org.opendaylight.yangtools.yang.binding.AugmentationHolder;
import org.opendaylight.yangtools.yang.binding.DataObject;
import com.fasterxml.jackson.annotation.JsonProperty;
import urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
import urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.mgmt._interface.DashboardParams;
import urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.mgmt._interface.EndpointType;
import urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.mgmt._interface.endpoint.type.CpBuilder;
import urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.mgmt._interface.endpoint.type.IpBuilder;
import urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.mgmt._interface.endpoint.type.VduIdBuilder;
/**
* Class that builds {@link urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface} instances.
*
* @see urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface
*
*/
public class MgmtInterfaceBuilder implements Builder<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface> {
private DashboardParams _dashboardParams;
private EndpointType _endpointType;
private PortNumber _port;
Map<java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>>, Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> augmentation = Collections.emptyMap();
public MgmtInterfaceBuilder() {
}
public MgmtInterfaceBuilder(MgmtInterface base) {
this._dashboardParams = base.getDashboardParams();
this._endpointType = base.getEndpointType();
this._port = base.getPort();
if (base instanceof MgmtInterfaceImpl) {
MgmtInterfaceImpl impl = (MgmtInterfaceImpl) base;
if (!impl.augmentation.isEmpty()) {
this.augmentation = new HashMap<>(impl.augmentation);
}
} else if (base instanceof AugmentationHolder) {
@SuppressWarnings("unchecked")
AugmentationHolder<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface> casted =(AugmentationHolder<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>) base;
if (!casted.augmentations().isEmpty()) {
this.augmentation = new HashMap<>(casted.augmentations());
}
}
}
public DashboardParams getDashboardParams() {
return _dashboardParams;
}
public EndpointType getEndpointType() {
return _endpointType;
}
public PortNumber getPort() {
return _port;
}
@SuppressWarnings("unchecked")
public <E extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> E getAugmentation(java.lang.Class<E> augmentationType) {
if (augmentationType == null) {
throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
}
return (E) augmentation.get(augmentationType);
}
public MgmtInterfaceBuilder setDashboardParams(final DashboardParams value) {
this._dashboardParams = value;
return this;
}
public MgmtInterfaceBuilder setEndpointType(final EndpointType value) {
this._endpointType = value;
return this;
}
public MgmtInterfaceBuilder setPort(final PortNumber value) {
this._port = value;
return this;
}
public MgmtInterfaceBuilder addAugmentation(java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> augmentationType, Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface> augmentationValue) {
if (augmentationValue == null) {
return removeAugmentation(augmentationType);
}
if (!(this.augmentation instanceof HashMap)) {
this.augmentation = new HashMap<>();
}
this.augmentation.put(augmentationType, augmentationValue);
return this;
}
public MgmtInterfaceBuilder removeAugmentation(java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> augmentationType) {
if (this.augmentation instanceof HashMap) {
this.augmentation.remove(augmentationType);
}
return this;
}
@Override
public MgmtInterface build() {
return new MgmtInterfaceImpl(this);
}
public static final class MgmtInterfaceImpl implements MgmtInterface {
@Override
public java.lang.Class<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface> getImplementedInterface() {
return urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface.class;
}
@JsonProperty("dashboard-params")
private final DashboardParams _dashboardParams;
@JsonProperty("endpoint-type")
private EndpointType _endpointType;
@JsonProperty("port")
private final PortNumber _port;
private Map<java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>>, Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> augmentation = Collections.emptyMap();
private MgmtInterfaceImpl(MgmtInterfaceBuilder base) {
this._dashboardParams = base.getDashboardParams();
this._endpointType = base.getEndpointType();
this._port = base.getPort();
switch (base.augmentation.size()) {
case 0:
this.augmentation = Collections.emptyMap();
break;
case 1:
final Map.Entry<java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>>, Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> e = base.augmentation.entrySet().iterator().next();
this.augmentation = Collections.<java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>>, Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>>singletonMap(e.getKey(), e.getValue());
break;
default :
this.augmentation = new HashMap<>(base.augmentation);
}
}
public MgmtInterfaceImpl(){
this( new MgmtInterfaceBuilder() );
}
@JsonProperty("vdu-id")
public void setVduidAsEndpointType(String s){
_endpointType = (new VduIdBuilder()).build() ;
}
@JsonProperty("cp")
public void setCPAsEndpointType(String s){
_endpointType = (new CpBuilder()).build() ;
}
@JsonProperty("ip")
public void setIPAsEndpointType(String s){
_endpointType = (new IpBuilder()).build() ;
}
@Override
public DashboardParams getDashboardParams() {
return _dashboardParams;
}
@Override
public EndpointType getEndpointType() {
return _endpointType;
}
@Override
public PortNumber getPort() {
return _port;
}
@SuppressWarnings("unchecked")
@Override
public <E extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> E getAugmentation(java.lang.Class<E> augmentationType) {
if (augmentationType == null) {
throw new IllegalArgumentException("Augmentation Type reference cannot be NULL!");
}
return (E) augmentation.get(augmentationType);
}
private int hash = 0;
private volatile boolean hashValid = false;
@Override
public int hashCode() {
if (hashValid) {
return hash;
}
final int prime = 31;
int result = 1;
result = prime * result + Objects.hashCode(_dashboardParams);
result = prime * result + Objects.hashCode(_endpointType);
result = prime * result + Objects.hashCode(_port);
result = prime * result + Objects.hashCode(augmentation);
hash = result;
hashValid = true;
return result;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof DataObject)) {
return false;
}
if (!urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface.class.equals(((DataObject)obj).getImplementedInterface())) {
return false;
}
urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface other = (urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface)obj;
if (!Objects.equals(_dashboardParams, other.getDashboardParams())) {
return false;
}
if (!Objects.equals(_endpointType, other.getEndpointType())) {
return false;
}
if (!Objects.equals(_port, other.getPort())) {
return false;
}
if (getClass() == obj.getClass()) {
// Simple case: we are comparing against self
MgmtInterfaceImpl otherImpl = (MgmtInterfaceImpl) obj;
if (!Objects.equals(augmentation, otherImpl.augmentation)) {
return false;
}
} else {
// Hard case: compare our augments with presence there...
for (Map.Entry<java.lang.Class<? extends Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>>, Augmentation<urn.ietf.params.xml.ns.yang.nfvo.vnfd.rev150910.vnfd.descriptor.MgmtInterface>> e : augmentation.entrySet()) {
if (!e.getValue().equals(other.getAugmentation(e.getKey()))) {
return false;
}
}
// .. and give the other one the chance to do the same
if (!obj.equals(this)) {
return false;
}
}
return true;
}
@Override
public java.lang.String toString() {
java.lang.String name = "MgmtInterface [";
java.lang.StringBuilder builder = new java.lang.StringBuilder (name);
if (_dashboardParams != null) {
builder.append("_dashboardParams=");
builder.append(_dashboardParams);
builder.append(", ");
}
if (_endpointType != null) {
builder.append("_endpointType=");
builder.append(_endpointType);
builder.append(", ");
}
if (_port != null) {
builder.append("_port=");
builder.append(_port);
}
final int builderLength = builder.length();
final int builderAdditionalLength = builder.substring(name.length(), builderLength).length();
if (builderAdditionalLength > 2 && !builder.substring(builderLength - 2, builderLength).equals(", ")) {
builder.append(", ");
}
builder.append("augmentation=");
builder.append(augmentation.values());
return builder.append(']').toString();
}
}
}
|
3e072a5cdec6c49be842044b5d04fe29c366b528
| 3,181 |
java
|
Java
|
app/src/main/java/com/example/Kratin/MainActivity.java
|
sumra123/Personal-Doctor
|
58b3507229a96b5e81b46a26dd34f86f93a23b4f
|
[
"BSL-1.0"
] | null | null | null |
app/src/main/java/com/example/Kratin/MainActivity.java
|
sumra123/Personal-Doctor
|
58b3507229a96b5e81b46a26dd34f86f93a23b4f
|
[
"BSL-1.0"
] | null | null | null |
app/src/main/java/com/example/Kratin/MainActivity.java
|
sumra123/Personal-Doctor
|
58b3507229a96b5e81b46a26dd34f86f93a23b4f
|
[
"BSL-1.0"
] | null | null | null | 29.183486 | 90 | 0.651053 | 3,026 |
package com.example.Kratin;
import androidx.annotation.RequiresApi;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.ViewPager;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import androidx.appcompat.widget.Toolbar;
import com.example.Kratin.Medical.MedicalProblems;
import java.util.Timer;
import java.util.TimerTask;
public class MainActivity extends AppCompatActivity {
ViewPager mViewPager;
Toolbar toolbar;
// images array
int[] images = {R.drawable.tip1, R.drawable.tip11, R.drawable.tip222, R.drawable.tip6,
R.drawable.tip44};
// Creating Object of ViewPagerAdapter
ViewPagerAdapter mViewPagerAdapter;
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// toolbar=(Toolbar)findViewById(R.id.toolbar);
//setSupportActionBar(toolbar);
final Handler mHandler = new Handler();
mViewPager = (ViewPager)findViewById(R.id.viewPager);
// Initializing the ViewPagerAdapter
mViewPagerAdapter = new ViewPagerAdapter(MainActivity.this, images);
// Adding the Adapter to the ViewPager
mViewPager.setAdapter(mViewPagerAdapter);
int delay = 1000; // delay for 1 sec.
int period = 5000; // repeat every 5 sec.
Timer timer = new Timer();
final Runnable mUpdateResults = new Runnable() {
public void run() {
mViewPager.setAdapter(mViewPagerAdapter);
}
};
timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
mHandler.post(mUpdateResults);
}
}, delay, period);
}
public void drreminder(View view) {
Intent intent=new Intent(getApplicationContext(),AlarmMe.class);
startActivity(intent);
}
public void calories(View view) {
Intent intent=new Intent(getApplicationContext(),profile.class);
startActivity(intent);
}
public void medical(View view) {
Intent intent=new Intent(getApplicationContext(), MedicalProblems.class);
startActivity(intent);
}
public void Health(View view) {
Intent intent=new Intent(getApplicationContext(),Primary.class);
startActivity(intent);
}
@Override
public void onBackPressed() {
new AlertDialog.Builder(this)
.setTitle("Really Exit?")
.setMessage("Are you sure you want to exit?")
.setNegativeButton(android.R.string.no, null)
.setPositiveButton(android.R.string.yes, (arg0, arg1) -> {
MainActivity.super.onBackPressed();
finish();
System.exit(0);
}).create().show();
}
public void abt(View view) {
Intent intent=new Intent(MainActivity.this,AboutApp.class);
startActivity(intent);
}
}
|
3e072bf96f333da196dd9dd8cce26e725b3d0e1c
| 30,385 |
java
|
Java
|
BM/OpenJML/src/org/jmlspecs/openjml/strongarm/JmlInfer.java
|
mtaimoorkhan/jml4sec
|
e5a993982fa46b7396a9b2543bebd05e3a0bb7a8
|
[
"MIT"
] | null | null | null |
BM/OpenJML/src/org/jmlspecs/openjml/strongarm/JmlInfer.java
|
mtaimoorkhan/jml4sec
|
e5a993982fa46b7396a9b2543bebd05e3a0bb7a8
|
[
"MIT"
] | null | null | null |
BM/OpenJML/src/org/jmlspecs/openjml/strongarm/JmlInfer.java
|
mtaimoorkhan/jml4sec
|
e5a993982fa46b7396a9b2543bebd05e3a0bb7a8
|
[
"MIT"
] | null | null | null | 40.785235 | 215 | 0.502584 | 3,027 |
package org.jmlspecs.openjml.strongarm;
import static com.sun.tools.javac.code.Flags.ENUM;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import org.jmlspecs.annotation.NonNull;
import org.jmlspecs.openjml.JmlOption;
import org.jmlspecs.openjml.JmlPretty;
import org.jmlspecs.openjml.JmlSpecs;
import org.jmlspecs.openjml.JmlTree;
import org.jmlspecs.openjml.JmlTreeUtils;
import org.jmlspecs.openjml.Strings;
import org.jmlspecs.openjml.Utils;
import org.jmlspecs.openjml.JmlTree.JmlClassDecl;
import org.jmlspecs.openjml.JmlTree.JmlCompilationUnit;
import org.jmlspecs.openjml.JmlTree.JmlImport;
import org.jmlspecs.openjml.JmlTree.JmlMethodClause;
import org.jmlspecs.openjml.JmlTree.JmlMethodDecl;
import org.jmlspecs.openjml.JmlTree.JmlVariableDecl;
import org.jmlspecs.openjml.esc.JmlAssertionAdder;
import org.jmlspecs.openjml.ext.OptionsInfer;
import org.jmlspecs.openjml.vistors.JmlTreeScanner;
import com.sun.tools.javac.code.Flags;
import com.sun.tools.javac.code.Symtab;
import com.sun.tools.javac.tree.JCTree;
import com.sun.tools.javac.tree.JCTree.JCAnnotation;
import com.sun.tools.javac.tree.JCTree.JCClassDecl;
import com.sun.tools.javac.tree.JCTree.JCExpression;
import com.sun.tools.javac.tree.JCTree.JCIdent;
import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
import com.sun.tools.javac.util.Context;
import com.sun.tools.javac.util.List;
import com.sun.tools.javac.util.Log;
import com.sun.tools.javac.util.Log.WriterKind;
/**
* This class is the main driver for executing contract inference on a Java/JML AST.
* The structure of the driver is heavily based on the other drivers (JmlRac and JmlEsc).
*
* @author John L. Singleton
*/
public abstract class JmlInfer<T extends JmlInfer<?>> extends JmlTreeScanner {
/** The compilation context, needed to get common tools, but unique to this compilation run*/
@NonNull Context context;
/** Used to obtain cached symbols, such as basic types */
@NonNull Symtab syms;
/** The tool to log problem reports */
@NonNull Log log;
/** The OpenJML utilities object */
@NonNull Utils utils;
final protected JmlTreeUtils treeutils;
final protected JmlTree.Maker M;
/** true if compiler options are set to a verbose mode */
boolean verbose;
/** Just for debugging contract inference */
public static boolean inferdebug = false;
/** The assertion adder instance used to translate */
public JmlAssertionAdder assertionAdder;
/** the contracts will be printed to stdout **/
public boolean printContracts = false;
/** the contracts will be printed to the filesystem **/
public boolean persistContracts = false;
/** the contracts will be weaved into the source code **/
public boolean weaveContracts = false;
/** the contracts will have a INFERRED key **/
public boolean printKey = true;
private static final String inferenceKey = "INFERRED";
protected boolean didInfer = false;
/** a container to hold the inferred specs -- this will be saved/flushed between visits to classes **/
public ArrayList<JCMethodDecl> inferredSpecs = new ArrayList<JCMethodDecl>();
public Path persistPath;
public String currentFilename;
public JCClassDecl lastClass;
/** The JmlInfer constructor, which initializes all the tools and other fields. */
public JmlInfer(Context context) {
this.context = context;
this.syms = Symtab.instance(context);
this.log = Log.instance(context);
this.utils = Utils.instance(context);
this.inferdebug = JmlOption.isOption(context, OptionsInfer.INFER_DEBUG);
this.treeutils = JmlTreeUtils.instance(context);
this.M = JmlTree.Maker.instance(context);
// verbose will print all the chatter
this.verbose = inferdebug || JmlOption.isOption(context,"-verbose") // The Java verbose option
|| utils.jmlverbose >= Utils.JMLVERBOSE;
// print contracts will print the derived contracts
this.printContracts = JmlOption.isOption(context, JmlOption.SHOW);
// we will save contracts
this.persistContracts = JmlOption.isOption(context, OptionsInfer.INFER_PERSIST);
this.weaveContracts = JmlOption.value(context, OptionsInfer.INFER_PERSIST).equalsIgnoreCase("java");
// but to where?
if(this.persistContracts && this.weaveContracts == false){
if(JmlOption.isOption(context, OptionsInfer.INFER_PERSIST_PATH)){ // -infer-persist-path dominates
persistPath = Paths.get(JmlOption.value(context, OptionsInfer.INFER_PERSIST_PATH));
}else if(JmlOption.isOption(context, JmlOption.SPECS)){ // followed by -specspath
persistPath = Paths.get(JmlOption.value(context, JmlOption.SPECS));
}else{ // failing those options, we default to wherever the class source is
persistPath = null;
}
}else{
this.persistContracts = false;
}
this.printKey = Boolean.parseBoolean(JmlOption.value(context, OptionsInfer.INFER_TAG));
}
/** this allows subclasses to have their own keys **/
public abstract Context.Key<T> getKey();
/** Initializes assertionAdder **/
public boolean check(JCTree tree) {
this.assertionAdder = new JmlAssertionAdder(context, false, false, true);
this._JML_ERROR = false;
try {
if(tree instanceof JmlClassDecl){
JmlClassDecl cd = (JmlClassDecl)tree;
if(skipExplicit(cd)){
markClassSkipped(cd, "(skipped because of SkipInfer annotation on a class-level element).");
return false;
}
}
assertionAdder.convert(tree); // get at the converted tree through the map
tree.accept(this);
return true;
}
catch(StackOverflowError so){
Exception e = new Exception("Stack Overflow in OpenJML");
if(tree instanceof JmlClassDecl){
JmlClassDecl cd = (JmlClassDecl)tree;
JmlInferPostConditions.emitStrongarmFatalError(cd.sourcefile.toString(), e);
this._JML_ERROR = true;
tree.accept(this);
}else{
JmlInferPostConditions.emitStrongarmFatalError(tree.toString(), e);
this._JML_ERROR = true;
tree.accept(this);
}
}
catch (Exception e) {
JmlInferPostConditions.emitStrongarmFatalError(tree.toString(), e);
///log.error("jml.internal","Should not be catching an exception in JmlInfer.check");
}
return false;
}
private boolean _JML_ERROR = false;
/** Visit a class definition */
@Override
public void visitClassDef(JCClassDecl node) {
// inference only works on method bodies (so there is nothing to infer)
if (node.sym.isInterface()) return;
// The super class takes care of visiting all the methods
utils.progress(1,1,"Inferring contracts for methods in " + utils.classQualifiedName(node.sym) ); //$NON-NLS-1$
super.visitClassDef(node);
utils.progress(1,1,"Completed inferring contracts for methods in " + utils.classQualifiedName(node.sym) ); //$NON-NLS-1$
lastClass = node;
}
public Path filenameForSource(String source){
// the java source
Path java = Paths.get(source);
// the jml source
Path jml = Paths.get(java.toString().substring(0, java.toString().toLowerCase().lastIndexOf(".java")) + ".jml");
if(persistPath!=null){
return persistPath.resolve(jml);
}else{
return jml;
}
}
public Path jsonFilenameForSource(String source, JmlMethodDecl methodDecl){
// the java source
Path java = Paths.get(source);
// the dot source
Path dot = Paths.get(java.toString().substring(0, java.toString().toLowerCase().lastIndexOf(".java")) + "." + methodDecl.sym.name.toString() + ".json");
if(persistPath!=null){
return persistPath.resolve(dot);
}else{
return dot;
}
}
public void weaveContract(String contract, String file, int position){
// for each of these things, seek to the position the method begins, then write it out
String mode = "rw";
try {
File tempFile = File.createTempFile(file,".tmp");
tempFile.deleteOnExit();
RandomAccessFile ra = new RandomAccessFile(file, mode);
RandomAccessFile temp = new RandomAccessFile(tempFile, "rw");
long fileSize = ra.length();
FileChannel sourceChannel = ra.getChannel();
FileChannel targetChannel = temp.getChannel();
sourceChannel.transferTo(position, (fileSize - position), targetChannel);
sourceChannel.truncate(position);
ra.seek(position);
// go backwards until we get a newline character.
long newlinePosition = -1;
StringBuffer buff = new StringBuffer();
while(ra.getFilePointer() >= 2){
ra.seek(ra.getFilePointer()-1);
int c = ra.read();
if(c==10){
newlinePosition = ra.getFilePointer();
break;
}
buff.append((char)c);
ra.seek(ra.getFilePointer()-1);
}
// first normalize the lines of the contract.
{
StringBuffer contractBuffer = new StringBuffer();
String[] parts = contract.split(System.lineSeparator());
for(int i=0; i< parts.length; i++){
if(i==0){
contractBuffer.append(parts[i]);
contractBuffer.append(System.lineSeparator());
continue;
}
contractBuffer.append(buff.toString() + " ");
contractBuffer.append(parts[i]);
contractBuffer.append(System.lineSeparator());
}
contract = contractBuffer.toString();
}
ra.seek(position);
ra.writeBytes(contract);
if(newlinePosition!=-1){
ra.writeBytes(buff.toString());
}
long newOffset = ra.getFilePointer();
targetChannel.position(0L);
sourceChannel.transferFrom(targetChannel, newOffset, (fileSize - position));
sourceChannel.close();
targetChannel.close();
} catch (IOException e) {
log.error("jml.internal","Unable to write path " + e.getMessage());
}
}
public void weaveContracts(String source, JmlClassDecl node){
// first, sort the inferredSpecs so that the later line numbers are FIRST.
inferredSpecs.sort((m1, m2) -> new Integer(m2.pos).compareTo(m1.pos));
// for each of these things, seek to the position the method begins, then write it out
String file = node.sourcefile.getName();
for(JCMethodDecl m : inferredSpecs){
if(m instanceof JmlMethodDecl){
utils.progress(1,1,"[INFER] Weaving Specs for: " + m.sym.toString());
int pos = m.pos;
if(m.mods != null && m.mods.pos != -1){
pos = m.mods.pos;
}
String contract = null;
if(printKey){
contract = SpecPretty.write(((JmlMethodDecl)m).cases, true, true, this.inferenceKey);
}else{
contract = SpecPretty.write(((JmlMethodDecl)m).cases, true);
}
try {
contract = contract.replaceAll("\\*\\/", "@*/");
// figure out how much in to go
int sep = 0;
for(sep = contract.indexOf('\n')+1; sep<contract.length(); sep++){
if(contract.charAt(sep)!=' '){
break;
}
}
sep = sep - contract.indexOf('\n') - 1;
Pattern regex = Pattern.compile("^((\\s){" + sep + "})", Pattern.MULTILINE);
Matcher match = regex.matcher(contract);
contract = match.replaceAll("@ ");
contract = contract.replaceAll(" @\\*\\/", "@*/");
}catch(Exception e){}
weaveContract(contract, file, pos);
}
}
}
public void flushContracts(String source, JmlClassDecl node){
if(this.persistContracts){
writeContracts(source, node);
}else if(this.weaveContracts){
weaveContracts(source, node);
}
// flush the specs
inferredSpecs.clear();
}
public void writeContracts(String source, JmlClassDecl node){
com.sun.tools.javac.util.List JDKList;
if(lastClass==null){ return; }
utils.progress(1,1,"[INFER] Persisting contracts for methods in " + utils.classQualifiedName(lastClass.sym) );
if((node.mods.flags & Flags.ENUM) !=0){
utils.progress(1,1,"[INFER] Won't wrote enum class methods in " + utils.classQualifiedName(lastClass.sym) );
return;
}
Path writeTo = filenameForSource(source);
// make the path
writeTo.toFile().getParentFile().mkdirs();
utils.progress(1,1,"[INFER] Persisting specs to: " + writeTo.toString());
try {
if(importsAdded(node)==false){
addImports(node);
}
promoteFields(node);
String spec = null;
if(printKey){
spec = SpecPretty.write(node, true, true, inferenceKey);
}else{
spec = SpecPretty.write(node, true);
}
Files.write(writeTo, spec.getBytes());
} catch (IOException e1) {
log.error("jml.internal","Unable to write path " + writeTo.toString());
}
}
private boolean isPrivate(JmlVariableDecl var){
return (var.mods.flags & Flags.PRIVATE) == Flags.PRIVATE || (var.mods.flags & Flags.PROTECTED) == Flags.PROTECTED;
}
private void promoteFields(JmlClassDecl node){
for(List<JCTree> defs = node.defs; defs.nonEmpty(); defs = defs.tail){
if(defs.head instanceof JmlVariableDecl){
JmlVariableDecl var = (JmlVariableDecl) defs.head;
if(isPrivate(var) && var.toString().contains("@SpecPublic")==false){
JCExpression t = M.Ident("org.jmlspecs.annotation.SpecPublic");
JCAnnotation ann = M.Annotation(t, List.<JCExpression> nil());
if(var.mods.annotations==null){
var.mods.annotations = List.of(ann);
}else{
var.mods.annotations = var.mods.annotations.append(ann);
}
}
}else if(defs.head instanceof JmlClassDecl){
promoteFields((JmlClassDecl)defs.head);
}
}
}
private boolean importsAdded(JmlClassDecl node){
List<JCTree> defs = null;
for(List<JCTree> stmts = node.toplevel.defs ; stmts.nonEmpty(); stmts = stmts.tail){
if(stmts.head instanceof JmlImport && ((JmlImport)stmts.head).qualid.toString().contains("org.jmlspecs.annotation.*")){
continue;
}
if(defs == null){
defs = List.of(stmts.head);
}else{
defs = defs.append(stmts.head);
}
}
node.toplevel.defs = defs;
return false;
}
private void addImports(JmlClassDecl node){
List<JCTree> defs = null;
JCIdent im = M.Ident("org.jmlspecs.annotation.*");
for(List<JCTree> stmts = node.toplevel.defs ; stmts.nonEmpty(); stmts = stmts.tail){
if(stmts.head instanceof JmlClassDecl){
if(defs == null){
defs = List.of((JCTree)M.JmlImport(im, false, false));
}else{
defs = defs.append(M.JmlImport(im, false, false));
}
}
if(defs == null){
defs = List.of(stmts.head);
}else{
defs = defs.append(stmts.head);
}
}
node.toplevel.defs = defs;
}
/** When we visit a method declaration, we translate and prove the method;
* we do not walk into the method any further from this call, only through
* the translation mechanism.
*/
@Override
public void visitMethodDef(@NonNull JCMethodDecl decl) {
if (decl.body == null) return;
if (!(decl instanceof JmlMethodDecl)) {
log.warning(decl.pos(),"jml.internal","Unexpected non-JmlMethodDecl in JmlInfer - not doing inference " + utils.qualifiedMethodSig(decl.sym)); //$NON-NLS-2$
return;
}
JmlMethodDecl methodDecl = (JmlMethodDecl)decl;
if (skipExplicit(methodDecl)) {
markMethodSkipped(methodDecl," (excluded by skipinfer)"); //$NON-NLS-1$
return;
}
// Do any nested classes and methods first (which will recursively call
// this method)
super.visitMethodDef(methodDecl);
if (!filter(methodDecl)) {
markMethodSkipped(methodDecl," (excluded by -method)"); //$NON-NLS-1$
return;
}
utils.progress(1,1,"Starting....");
doMethod(methodDecl);
return;
}
public boolean skipExplicit(JmlClassDecl decl) {
if (decl.mods != null) {
for (JCTree.JCAnnotation a : decl.mods.annotations) {
if (a != null && a.type.toString().equals("org.jmlspecs.annotation.SkipInfer")) { // FIXME - do this without converting to string
return true;
}
}
}
return false;
}
public boolean skipExplicit(JmlMethodDecl methodDecl) {
if (methodDecl.mods != null) {
for (JCTree.JCAnnotation a : methodDecl.mods.annotations) {
if (a != null && a.type.toString().equals("org.jmlspecs.annotation.SkipInfer")) { // FIXME - do this without converting to string
return true;
}
}
}
return false;
}
public boolean skipNoCode(JmlMethodDecl methodDecl){
boolean isConstructor = methodDecl.sym.isConstructor();
boolean canInfer = ((methodDecl.mods.flags & (Flags.SYNTHETIC|Flags.ABSTRACT|Flags.NATIVE)) == 0);
// skip constructors and other types of methods that lack code
if ((methodDecl.sym.owner == syms.objectType.tsym && isConstructor) || !canInfer){
return true;
}
return false;
}
public void markMethodSkipped(JmlMethodDecl methodDecl, String reason) {
utils.progress(1,1,"Skipping contract inference of " + utils.qualifiedMethodSig(methodDecl.sym) + reason); //$NON-NLS-1$ //$NON-NLS-2$
}
public void markClassSkipped(JmlClassDecl classDecl, String reason) {
utils.progress(1,1,"Skipping contract inference of " + utils.classQualifiedName(classDecl.sym) + reason); //$NON-NLS-1$ //$NON-NLS-2$
}
public abstract void inferContract(@NonNull JmlMethodDecl methodDecl);
public abstract String inferenceType();
protected void doMethod(@NonNull JmlMethodDecl methodDecl) {
if (skipExplicit(methodDecl)) {
markMethodSkipped(methodDecl," (because of SkipInfer annotation)");
return;
}
// skip constructors and other types of methods that lack code
if (skipNoCode(methodDecl)){
markMethodSkipped(methodDecl," (because it was a type of program construct that lacks inferable code)");
return;
}
// TODO -- do it in extended class?
// if(skipImplicit(methodDecl)){
// markMethodSkipped(methodDecl," (because postcondition was already available annotation)");
// return;
// }
try{
// also, let's not try to infer synthentic methods.
{
if(methodDecl.toString().contains("public <init>")){
return;
}
}
}catch(Exception e){}
utils.progress(1,1,"Starting " + inferenceType() + " inference of " + utils.qualifiedMethodSig(methodDecl.sym));
if (verbose) {
log.getWriter(WriterKind.NOTICE).println(Strings.empty);
log.getWriter(WriterKind.NOTICE).println("--------------------------------------"); //$NON-NLS-1$
log.getWriter(WriterKind.NOTICE).println(Strings.empty);
log.getWriter(WriterKind.NOTICE).println("STARTING INFERENCE OF " + utils.qualifiedMethodSig(methodDecl.sym) + " (" + JDKListUtils.countLOC(methodDecl.body) + " LOC)"); //$NON-NLS-1$
log.getWriter(WriterKind.NOTICE).println(JmlPretty.write(methodDecl.body));
}
//
//
// We need to be able to tell the difference between a OpenJML error and a Strongarm error. For this reason we
// will say we "start" the inference, but abort because of an error.
//
//
if(this._JML_ERROR){
if (verbose) {
log.getWriter(WriterKind.NOTICE).println(Strings.empty);
log.getWriter(WriterKind.NOTICE).println("--------------------------------------"); //$NON-NLS-1$
log.getWriter(WriterKind.NOTICE).println(Strings.empty);
log.getWriter(WriterKind.NOTICE).println("Inference ABORTED (OPENJML ERROR) " + utils.qualifiedMethodSig(methodDecl.sym) + " (" + JDKListUtils.countLOC(methodDecl.body) + " LOC)"); //$NON-NLS-1$
log.getWriter(WriterKind.NOTICE).println(JmlPretty.write(methodDecl.body));
}
return;
}
didInfer = false;
inferContract(methodDecl);
if(methodDecl.cases != null && methodDecl.methodSpecsCombined != null && didInfer){
inferredSpecs.add(methodDecl);
}
}
/** Return true if the method is to be checked, false if it is to be skipped.
* A warning that the method is being skipped is issued if it is being skipped
* and the verbosity is high enough.
* */
public boolean filter(JCMethodDecl methodDecl) {
String fullyQualifiedName = utils.qualifiedName(methodDecl.sym);
String simpleName = methodDecl.name.toString();
if (methodDecl.sym.isConstructor()) {
String constructorName = methodDecl.sym.owner.name.toString();
fullyQualifiedName = fullyQualifiedName.replace("<init>", constructorName);
simpleName = simpleName.replace("<init>", constructorName);
}
String fullyQualifiedSig = utils.qualifiedMethodSig(methodDecl.sym);
String methodsToDo = JmlOption.value(context,JmlOption.METHOD);
if (methodsToDo != null && !methodsToDo.isEmpty()) {
match: {
if (fullyQualifiedSig.equals(methodsToDo)) break match; // A hack to allow at least one signature-containing item in the methods list
for (String methodToDo: methodsToDo.split(",")) { //$NON-NLS-1$ //FIXME - this does not work when the methods list contains signatures containing commas
if (fullyQualifiedName.equals(methodToDo) ||
methodToDo.equals(simpleName) ||
fullyQualifiedSig.equals(methodToDo)) {
break match;
}
try {
if (Pattern.matches(methodToDo,fullyQualifiedName)) break match;
} catch(PatternSyntaxException e) {
// The methodToDo can be a regular string and does not
// need to be legal Pattern expression
// skip
}
}
if (utils.jmlverbose > Utils.PROGRESS) {
log.getWriter(WriterKind.NOTICE).println("Skipping " + fullyQualifiedName + " because it does not match " + methodsToDo); //$NON-NLS-1$//$NON-NLS-2$
}
return false;
}
}
String excludes = JmlOption.value(context,JmlOption.EXCLUDE);
if (excludes != null) {
for (String exclude: excludes.split(",")) { //$NON-NLS-1$
if (fullyQualifiedName.equals(exclude) ||
fullyQualifiedSig.equals(exclude) ||
simpleName.equals(exclude) ||
Pattern.matches(exclude,fullyQualifiedName)) {
if (utils.jmlverbose > Utils.PROGRESS)
log.getWriter(WriterKind.NOTICE).println("Skipping " + fullyQualifiedName + " because it is excluded by " + exclude); //$NON-NLS-1$ //$NON-NLS-2$
return false;
}
}
}
return true;
}
}
|
3e072e5b5596cb0fe2369d8bdda20eb17288a909
| 3,685 |
java
|
Java
|
org/team6204/frc/dshardware/DSHardware.java
|
FRCTeam6204/dshardware
|
a4be1e5a73c1b92360d8cac7c0bc8a058ba0c7d0
|
[
"MIT"
] | null | null | null |
org/team6204/frc/dshardware/DSHardware.java
|
FRCTeam6204/dshardware
|
a4be1e5a73c1b92360d8cac7c0bc8a058ba0c7d0
|
[
"MIT"
] | null | null | null |
org/team6204/frc/dshardware/DSHardware.java
|
FRCTeam6204/dshardware
|
a4be1e5a73c1b92360d8cac7c0bc8a058ba0c7d0
|
[
"MIT"
] | null | null | null | 25.413793 | 83 | 0.358752 | 3,028 |
package org.team6204.frc.dshardware;
import org.team6204.frc.components.PSoC5LP;
// DSHardware is an interface to our driver station hardware
// Mapped like so:
/*
* Diagram: Key:
* -----------------------------------------
* | | [|] | [|] : Master Switch
* | | H H | H : Switch
* | LAPTOP | H # | # : Red Square Button
* | SPACE | R R R R | R : Red LED Buttons
* | | G G G G | G : Green LED Buttons
* | | B B B B | B : Blue LED Buttons
* | | W W W W | W : White LED Buttons
* -----------------------------------------
*
* Input IDs:
* -----------------------------------------
* | | 21 |
* | | 19 20 |
* | LAPTOP | 18 17 |
* | SPACE | 4 3 2 1 |
* | | 8 7 6 5 |
* | | 12 11 10 9 |
* | | 16 15 14 13 |
* -----------------------------------------
*/
public class DSHardware extends PSoC5LP {
private final int[][] LED_BUTTON_MAP =
{
{ 4, 3, 2, 1 },
{ 8, 7, 6, 5 },
{ 12, 11, 10, 9 },
{ 16, 15, 14, 13 }
};
// Switch IDs
public enum Switch {
Master(21),
Right(20),
Left(19),
Red(18);
public final int id;
private boolean state;
private Switch(int _id) {
id = _id;
}
protected void setState(boolean on) {
state = on;
}
public boolean getState() {
return state;
}
}
// Button IDs
public enum Button {
RedSquare(17),
/*
* Button mappings by colour/row
*
* Button colours are addressed from right to left
* e.g. R1 R2 R3 R4
* G1 G2 G3 G4
* B1 B2 B3 B4
* W1 W2 W3 W4
*
*/
R1(4),
R2(3),
R3(2),
R4(1),
G1(8),
G2(7),
G3(6),
G4(5),
B1(12),
B2(11),
B3(10),
B4(9),
W1(16),
W2(15),
W3(14),
W4(13);
public final int id;
private Button(int _id) {
id = _id;
}
}
public DSHardware(int port) {
super(port);
for (Switch s : Switch.values()) {
getSwitch(s);
}
}
// Get the value of the master switch
public boolean getMaster() {
return getSwitch(Switch.Master);
}
// Get the value of the square red button
public boolean getRedButton() {
return getButton(Button.RedSquare);
}
public boolean getSwitch(Switch sw) {
boolean state = getRawButton(sw.id);
sw.setState(state);
return state;
}
public boolean getButton(Button button) {
return getRawButton(button.id);
}
// Get an LED button from a matrix coordinate
// 0 1 2 3
// 0 R R R R
// 1 G G G G
// 2 B B B B
// 3 W W W W
public boolean getButtonMatrix(final int i, final int j) {
return getRawButton(LED_BUTTON_MAP[i][j]);
}
}
|
3e072e89a62da67fccd5671a39f341f76017d755
| 1,465 |
java
|
Java
|
app/drawer/SignaturePicture.java
|
jsmadja/shmuphiscores
|
4715dd78c3056a590e3d38beb74e98fa3b8c344d
|
[
"Apache-2.0"
] | null | null | null |
app/drawer/SignaturePicture.java
|
jsmadja/shmuphiscores
|
4715dd78c3056a590e3d38beb74e98fa3b8c344d
|
[
"Apache-2.0"
] | null | null | null |
app/drawer/SignaturePicture.java
|
jsmadja/shmuphiscores
|
4715dd78c3056a590e3d38beb74e98fa3b8c344d
|
[
"Apache-2.0"
] | null | null | null | 39.594595 | 190 | 0.752901 | 3,029 |
package drawer;
import models.Player;
import models.Score;
import java.awt.*;
import java.awt.image.BufferedImage;
import static drawer.RankingGameConfiguration.COLOR_SHMUP_GREY;
import static drawer.RankingGameConfiguration.COLOR_SHMUP_TEXT;
import static java.awt.Font.PLAIN;
import static java.awt.RenderingHints.KEY_ANTIALIASING;
import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING;
import static java.awt.RenderingHints.VALUE_ANTIALIAS_ON;
import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON;
import static java.awt.image.BufferedImage.TYPE_INT_ARGB;
public class SignaturePicture {
public static final int WIDTH = 724;
private final static Font gameFont = new Font("Lucida", PLAIN, 11);
public static BufferedImage createSignaturePicture(Player player) {
BufferedImage bi = new BufferedImage(WIDTH, 15, TYPE_INT_ARGB);
Graphics2D graphics = bi.createGraphics();
FontMetrics fontMetrics = graphics.getFontMetrics();
graphics.setColor(COLOR_SHMUP_TEXT);
graphics.setFont(gameFont);
Score lastScore = player.getLastScore();
graphics.drawString(message(lastScore), 0, fontMetrics.getAscent());
return bi;
}
private static String message(Score lastScore) {
return "Dernier score réalisé " + lastScore.formattedDateInFrench() + " sur " + lastScore.game.title + " (" + lastScore.formattedValue() + "pts - " + lastScore.formattedRank() + ")";
}
}
|
3e072e8f1bb45a72573b69cb93fbff93e335d9ef
| 2,322 |
java
|
Java
|
engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
|
aleskxyz/cloudstack
|
2700beb4fb1206f93829b8c4085479a8f416833d
|
[
"Apache-2.0"
] | 1,131 |
2015-01-08T18:59:06.000Z
|
2022-03-29T11:31:10.000Z
|
engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
|
aleskxyz/cloudstack
|
2700beb4fb1206f93829b8c4085479a8f416833d
|
[
"Apache-2.0"
] | 5,908 |
2015-01-13T15:28:37.000Z
|
2022-03-31T20:31:07.000Z
|
engine/api/src/main/java/org/apache/cloudstack/engine/subsystem/api/storage/PrimaryDataStoreInfo.java
|
Rostov1991/cloudstack
|
4abe8385e0721793d5dae8f195303d010c8ff8d2
|
[
"Apache-2.0"
] | 1,083 |
2015-01-05T01:16:52.000Z
|
2022-03-31T12:14:10.000Z
| 36.28125 | 90 | 0.769595 | 3,030 |
/*
* 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.cloudstack.engine.subsystem.api.storage;
import java.util.Map;
import org.apache.cloudstack.engine.subsystem.api.storage.disktype.DiskFormat;
import com.cloud.hypervisor.Hypervisor.HypervisorType;
import com.cloud.storage.Storage.StoragePoolType;
import com.cloud.storage.StoragePool;
public interface PrimaryDataStoreInfo extends StoragePool {
static final String MANAGED = "managed";
static final String STORAGE_HOST= "storageHost";
static final String STORAGE_PORT = "storagePort";
static final String MANAGED_STORE_TARGET = "managedStoreTarget";
static final String MANAGED_STORE_TARGET_ROOT_VOLUME = "managedStoreTargetRootVolume";
static final String CHAP_INITIATOR_USERNAME = "chapInitiatorUsername";
static final String CHAP_INITIATOR_SECRET = "chapInitiatorSecret";
static final String CHAP_TARGET_USERNAME = "chapTargetUsername";
static final String CHAP_TARGET_SECRET = "chapTargetSecret";
static final String REMOVE_AFTER_COPY = "removeAfterCopy";
static final String VOLUME_SIZE = "volumeSize";
boolean isHypervisorSupported(HypervisorType hypervisor);
boolean isLocalStorageSupported();
boolean isVolumeDiskTypeSupported(DiskFormat diskType);
@Override
String getUuid();
@Override
StoragePoolType getPoolType();
boolean isManaged();
void setDetails(Map<String, String> details);
Map<String, String> getDetails();
PrimaryDataStoreLifeCycle getLifeCycle();
Long getParent();
}
|
3e072ed2f02be1d9a76b5354b88f0d9f4d61ea56
| 1,160 |
java
|
Java
|
rxpanda/src/main/java/com/pandaq/rxpanda/requests/okhttp/PatchRequest.java
|
PandaQAQ/RxPanda
|
e64972dc2de74032c177fec3e95e247156dea11b
|
[
"Apache-2.0"
] | 13 |
2019-07-19T02:46:16.000Z
|
2021-07-28T03:29:39.000Z
|
rxpanda/src/main/java/com/pandaq/rxpanda/requests/okhttp/PatchRequest.java
|
PandaQAQ/RxPanda
|
e64972dc2de74032c177fec3e95e247156dea11b
|
[
"Apache-2.0"
] | 6 |
2019-07-05T07:49:32.000Z
|
2021-09-26T01:08:56.000Z
|
rxpanda/src/main/java/com/pandaq/rxpanda/requests/okhttp/PatchRequest.java
|
PandaQAQ/RxPanda
|
e64972dc2de74032c177fec3e95e247156dea11b
|
[
"Apache-2.0"
] | 4 |
2019-07-10T02:57:13.000Z
|
2020-04-28T14:01:16.000Z
| 27.023256 | 66 | 0.595525 | 3,031 |
package com.pandaq.rxpanda.requests.okhttp;
import com.pandaq.rxpanda.RxPanda;
import com.pandaq.rxpanda.observer.ApiObserver;
import com.pandaq.rxpanda.requests.okhttp.base.HttpRequest;
import java.lang.reflect.Type;
import io.reactivex.rxjava3.core.Observable;
/**
* Created by huxinyu on 2019/6/3.
* Email : [email protected]
* Description :
*/
public class PatchRequest extends HttpRequest<PatchRequest> {
public PatchRequest(String url) {
super(url);
}
@Override
protected <T> Observable<T> execute(Type type) {
return mApi.patch(url, localParams)
.doOnSubscribe(disposable -> {
if (tag != null) {
RxPanda.manager().addTag(tag, disposable);
}
})
.compose(httpTransformer(type));
}
@SuppressWarnings("unchecked")
@Override
protected <T> void execute(ApiObserver<T> callback) {
if (tag != null) {
RxPanda.manager().addTag(tag, callback);
}
this.execute(getType(callback))
.map(o -> (T) o)
.subscribe(callback);
}
}
|
3e072f1ca81bdd825c3440b513ae87628e587fee
| 100 |
java
|
Java
|
bulldog-core/src/main/java/io/silverspoon/bulldog/core/io/bus/i2c/I2cSda.java
|
jorgevs/bulldog
|
2421d231adbe2e471f125cbefff1180fb5930a2b
|
[
"Apache-2.0"
] | null | null | null |
bulldog-core/src/main/java/io/silverspoon/bulldog/core/io/bus/i2c/I2cSda.java
|
jorgevs/bulldog
|
2421d231adbe2e471f125cbefff1180fb5930a2b
|
[
"Apache-2.0"
] | null | null | null |
bulldog-core/src/main/java/io/silverspoon/bulldog/core/io/bus/i2c/I2cSda.java
|
jorgevs/bulldog
|
2421d231adbe2e471f125cbefff1180fb5930a2b
|
[
"Apache-2.0"
] | null | null | null | 16.666667 | 47 | 0.8 | 3,032 |
package io.silverspoon.bulldog.core.io.bus.i2c;
public interface I2cSda extends I2cPinFeature {
}
|
3e072f97b0cecd6036292d28f0de89574cfe9476
| 336 |
java
|
Java
|
hr-system/src/main/java/com/xlaser4j/hr/service/IPositionService.java
|
poppycoding/2020-lab-02
|
321ce41a0234a5de88c8bea7d21206a6cf4b67a6
|
[
"RSA-MD"
] | null | null | null |
hr-system/src/main/java/com/xlaser4j/hr/service/IPositionService.java
|
poppycoding/2020-lab-02
|
321ce41a0234a5de88c8bea7d21206a6cf4b67a6
|
[
"RSA-MD"
] | 1 |
2021-06-25T15:30:00.000Z
|
2021-06-25T15:30:00.000Z
|
hr-system/src/main/java/com/xlaser4j/hr/service/IPositionService.java
|
oakparkoak/2020-lab-02
|
321ce41a0234a5de88c8bea7d21206a6cf4b67a6
|
[
"RSA-MD"
] | null | null | null | 21 | 64 | 0.744048 | 3,033 |
package com.xlaser4j.hr.service;
import com.xlaser4j.hr.entity.PositionDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @package: com.xlaser4j.hr.service
* @author: Elijah.D
* @time: 2020/2/9 17:28
* @description:
* @modified: Elijah.D
*/
public interface IPositionService extends IService<PositionDO> {
}
|
3e072fde8e498dd273de1ff15d455061288c9683
| 1,583 |
java
|
Java
|
src/test/java/guru/springframework/sfgpetclinic/controllers/VetControllerTest.java
|
KulovacNedim/testing-java-junit5
|
c4d8dc00ed4b5776ff30ed165bec93f05c5e3777
|
[
"Apache-2.0"
] | null | null | null |
src/test/java/guru/springframework/sfgpetclinic/controllers/VetControllerTest.java
|
KulovacNedim/testing-java-junit5
|
c4d8dc00ed4b5776ff30ed165bec93f05c5e3777
|
[
"Apache-2.0"
] | null | null | null |
src/test/java/guru/springframework/sfgpetclinic/controllers/VetControllerTest.java
|
KulovacNedim/testing-java-junit5
|
c4d8dc00ed4b5776ff30ed165bec93f05c5e3777
|
[
"Apache-2.0"
] | null | null | null | 33.680851 | 78 | 0.746052 | 3,034 |
package guru.springframework.sfgpetclinic.controllers;
import guru.springframework.sfgpetclinic.ControllerTests;
import guru.springframework.sfgpetclinic.fauxspring.Model;
import guru.springframework.sfgpetclinic.fauxspring.ModelMapImpl;
import guru.springframework.sfgpetclinic.model.Vet;
import guru.springframework.sfgpetclinic.services.SpecialtyService;
import guru.springframework.sfgpetclinic.services.VetService;
import guru.springframework.sfgpetclinic.services.map.SpecialityMapService;
import guru.springframework.sfgpetclinic.services.map.VetMapService;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Set;
import static org.assertj.core.api.Assertions.assertThat;
class VetControllerTest implements ControllerTests {
VetService vetService;
SpecialtyService specialtyService;
VetController vetController;
@BeforeEach
void setUp() {
specialtyService = new SpecialityMapService();
vetService = new VetMapService(specialtyService);
vetController = new VetController(vetService);
Vet vet1 = new Vet(1L, "joe", "buck", null);
Vet vet2 = new Vet(21L, "jimmy", "smith", null);
vetService.save(vet1);
vetService.save(vet2);
}
@Test
void listVets() {
Model model = new ModelMapImpl();
String view = vetController.listVets(model);
Set modelAtribute = (Set) ((ModelMapImpl) model).getMap().get("vets");
assertThat("vets/index").isEqualTo(view);
assertThat(modelAtribute.size()).isEqualTo(2);
}
}
|
3e073071a4264304b3c3fc87026cb3690cdad47c
| 94 |
java
|
Java
|
src/main/java/de/nerogar/sandstormBot/player/INextCache.java
|
nightfrost/SandstormBot
|
fdd593eab19c97869e083ef773d1c40e19b39135
|
[
"MIT"
] | 7 |
2018-11-11T18:18:00.000Z
|
2021-07-17T10:35:50.000Z
|
src/main/java/de/nerogar/sandstormBot/player/INextCache.java
|
nightfrost/SandstormBot
|
fdd593eab19c97869e083ef773d1c40e19b39135
|
[
"MIT"
] | 4 |
2018-12-16T20:04:19.000Z
|
2019-06-01T17:02:18.000Z
|
src/main/java/de/nerogar/sandstormBot/player/INextCache.java
|
nightfrost/SandstormBot
|
fdd593eab19c97869e083ef773d1c40e19b39135
|
[
"MIT"
] | 3 |
2020-09-25T18:13:50.000Z
|
2022-02-05T20:14:52.000Z
| 11.75 | 39 | 0.765957 | 3,035 |
package de.nerogar.sandstormBot.player;
public interface INextCache {
Song cacheNext();
}
|
3e0730d4c851e458ef63291e349c1f2895ce8c39
| 178,753 |
java
|
Java
|
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/CreateDBClusterRequest.java
|
JogoShugh/aws-sdk-java
|
f547914523904a1b2e31f31fd5ba6b3acfdcef0e
|
[
"Apache-2.0"
] | 1 |
2020-08-27T17:36:34.000Z
|
2020-08-27T17:36:34.000Z
|
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/CreateDBClusterRequest.java
|
yijiangliu/aws-sdk-java
|
b75779a2ab0fe14c91da1e54be25b770385affac
|
[
"Apache-2.0"
] | null | null | null |
aws-java-sdk-rds/src/main/java/com/amazonaws/services/rds/model/CreateDBClusterRequest.java
|
yijiangliu/aws-sdk-java
|
b75779a2ab0fe14c91da1e54be25b770385affac
|
[
"Apache-2.0"
] | null | null | null | 40.061183 | 156 | 0.60164 | 3,036 |
/*
* Copyright 2015-2020 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.rds.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
* <p/>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBCluster" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateDBClusterRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS
* Regions and Availability Zones, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<String> availabilityZones;
/**
* <p>
* The number of days for which automated backups are retained.
* </p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
* </ul>
*/
private Integer backupRetentionPeriod;
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified CharacterSet.
* </p>
*/
private String characterSetName;
/**
* <p>
* The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS doesn't
* create a database in the DB cluster you are creating.
* </p>
*/
private String databaseName;
/**
* <p>
* The DB cluster identifier. This parameter is stored as a lowercase string.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
* </p>
*/
private String dBClusterIdentifier;
/**
* <p>
* The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a value, then
* the default DB cluster parameter group for the specified DB engine and version is used.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
* </ul>
*/
private String dBClusterParameterGroupName;
/**
* <p>
* A list of EC2 VPC security groups to associate with this DB cluster.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<String> vpcSecurityGroupIds;
/**
* <p>
* A DB subnet group to associate with this DB cluster.
* </p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
* </p>
*/
private String dBSubnetGroupName;
/**
* <p>
* The name of the database engine to be used for this DB cluster.
* </p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
* </p>
*/
private String engine;
/**
* <p>
* The version number of the database engine to use.
* </p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora), use the
* following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible Aurora), use
* the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
* </p>
*/
private String engineVersion;
/**
* <p>
* The port number on which the instances in the DB cluster accept connections.
* </p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
* </p>
*/
private Integer port;
/**
* <p>
* The name of the master user for the DB cluster.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
* </ul>
*/
private String masterUsername;
/**
* <p>
* The password for the master database user. This password can contain any printable ASCII character except "/",
* """, or "@".
* </p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
* </p>
*/
private String masterUserPassword;
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified option group.
* </p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB cluster once
* it is associated with a DB cluster.
* </p>
*/
private String optionGroupName;
/**
* <p>
* The daily time range during which automated backups are created if automated backups are enabled using the
* <code>BackupRetentionPeriod</code> parameter.
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the
* time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
* </ul>
*/
private String preferredBackupWindow;
/**
* <p>
* The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
* </p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring
* on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
* </p>
*/
private String preferredMaintenanceWindow;
/**
* <p>
* The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a read
* replica.
* </p>
*/
private String replicationSourceIdentifier;
/**
* <p>
* Tags to assign to the DB cluster.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<Tag> tags;
/**
* <p>
* A value that indicates whether the DB cluster is encrypted.
* </p>
*/
private Boolean storageEncrypted;
/**
* <p>
* The AWS KMS key identifier for an encrypted DB cluster.
* </p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a DB
* cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster, then you
* can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code> isn't
* specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set <code>KmsKeyId</code>
* to a KMS key ID that is valid in the destination AWS Region. This key is used to encrypt the read replica in that
* AWS Region.
* </p>
*/
private String kmsKeyId;
/**
* <p>
* A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to be called
* in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB cluster.
* </p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be executed
* in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB cluster in
* the destination AWS Region. This should refer to the same KMS key for both the <code>CreateDBCluster</code>
* action that is called in the destination AWS Region, and the action contained in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be copied.
* This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For example, if you
* are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests:
* Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing
* Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation
* that can be executed in the source AWS Region.
* </p>
* </note>
*/
private String preSignedUrl;
/**
* <p>
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database
* accounts. By default, mapping is disabled.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM Database
* Authentication</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
*/
private Boolean enableIAMDatabaseAuthentication;
/**
* <p>
* The target backtrack window, in seconds. To disable backtracking, set this value to 0.
* </p>
* <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
* </ul>
*/
private Long backtrackWindow;
/**
* <p>
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on
* the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<String> enableCloudwatchLogsExports;
/**
* <p>
* The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.
* </p>
* <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL version
* 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use <code>provisioned</code> engine
* mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following sections in
* the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
* </ul>
*/
private String engineMode;
/**
* <p>
* For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
* </p>
*/
private ScalingConfiguration scalingConfiguration;
/**
* <p>
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when
* deletion protection is enabled. By default, deletion protection is disabled.
* </p>
*/
private Boolean deletionProtection;
/**
* <p>
* The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database cluster.
* </p>
*/
private String globalClusterIdentifier;
/**
* <p>
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By default, the
* HTTP endpoint is disabled.
* </p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the Aurora
* Serverless DB cluster. You can also query your database from inside the RDS console with the query editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for Aurora
* Serverless</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*/
private Boolean enableHttpEndpoint;
/**
* <p>
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default
* is not to copy them.
* </p>
*/
private Boolean copyTagsToSnapshot;
/**
* <p>
* The Active Directory directory ID to create the DB cluster in.
* </p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that connect to
* the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*/
private String domain;
/**
* <p>
* Specify the name of the IAM role to be used when making API calls to the Directory Service.
* </p>
*/
private String domainIAMRoleName;
/**
* <p>
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This parameter
* only applies to DB clusters that are secondary clusters in an Aurora global database. By default, Aurora
* disallows write operations for secondary clusters.
* </p>
*/
private Boolean enableGlobalWriteForwarding;
/** The region where the source instance is located. */
private String sourceRegion;
/**
* <p>
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS
* Regions and Availability Zones, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @return A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on
* AWS Regions and Availability Zones, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
*/
public java.util.List<String> getAvailabilityZones() {
if (availabilityZones == null) {
availabilityZones = new com.amazonaws.internal.SdkInternalList<String>();
}
return availabilityZones;
}
/**
* <p>
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS
* Regions and Availability Zones, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param availabilityZones
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on
* AWS Regions and Availability Zones, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
*/
public void setAvailabilityZones(java.util.Collection<String> availabilityZones) {
if (availabilityZones == null) {
this.availabilityZones = null;
return;
}
this.availabilityZones = new com.amazonaws.internal.SdkInternalList<String>(availabilityZones);
}
/**
* <p>
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS
* Regions and Availability Zones, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setAvailabilityZones(java.util.Collection)} or {@link #withAvailabilityZones(java.util.Collection)} if
* you want to override the existing values.
* </p>
*
* @param availabilityZones
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on
* AWS Regions and Availability Zones, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withAvailabilityZones(String... availabilityZones) {
if (this.availabilityZones == null) {
setAvailabilityZones(new com.amazonaws.internal.SdkInternalList<String>(availabilityZones.length));
}
for (String ele : availabilityZones) {
this.availabilityZones.add(ele);
}
return this;
}
/**
* <p>
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on AWS
* Regions and Availability Zones, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param availabilityZones
* A list of Availability Zones (AZs) where instances in the DB cluster can be created. For information on
* AWS Regions and Availability Zones, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.RegionsAndAvailabilityZones.html"
* >Choosing the Regions and Availability Zones</a> in the <i>Amazon Aurora User Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withAvailabilityZones(java.util.Collection<String> availabilityZones) {
setAvailabilityZones(availabilityZones);
return this;
}
/**
* <p>
* The number of days for which automated backups are retained.
* </p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
* </ul>
*
* @param backupRetentionPeriod
* The number of days for which automated backups are retained.</p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
*/
public void setBackupRetentionPeriod(Integer backupRetentionPeriod) {
this.backupRetentionPeriod = backupRetentionPeriod;
}
/**
* <p>
* The number of days for which automated backups are retained.
* </p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
* </ul>
*
* @return The number of days for which automated backups are retained.</p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
*/
public Integer getBackupRetentionPeriod() {
return this.backupRetentionPeriod;
}
/**
* <p>
* The number of days for which automated backups are retained.
* </p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
* </ul>
*
* @param backupRetentionPeriod
* The number of days for which automated backups are retained.</p>
* <p>
* Default: 1
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be a value from 1 to 35
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withBackupRetentionPeriod(Integer backupRetentionPeriod) {
setBackupRetentionPeriod(backupRetentionPeriod);
return this;
}
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified CharacterSet.
* </p>
*
* @param characterSetName
* A value that indicates that the DB cluster should be associated with the specified CharacterSet.
*/
public void setCharacterSetName(String characterSetName) {
this.characterSetName = characterSetName;
}
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified CharacterSet.
* </p>
*
* @return A value that indicates that the DB cluster should be associated with the specified CharacterSet.
*/
public String getCharacterSetName() {
return this.characterSetName;
}
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified CharacterSet.
* </p>
*
* @param characterSetName
* A value that indicates that the DB cluster should be associated with the specified CharacterSet.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withCharacterSetName(String characterSetName) {
setCharacterSetName(characterSetName);
return this;
}
/**
* <p>
* The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS doesn't
* create a database in the DB cluster you are creating.
* </p>
*
* @param databaseName
* The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS
* doesn't create a database in the DB cluster you are creating.
*/
public void setDatabaseName(String databaseName) {
this.databaseName = databaseName;
}
/**
* <p>
* The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS doesn't
* create a database in the DB cluster you are creating.
* </p>
*
* @return The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS
* doesn't create a database in the DB cluster you are creating.
*/
public String getDatabaseName() {
return this.databaseName;
}
/**
* <p>
* The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS doesn't
* create a database in the DB cluster you are creating.
* </p>
*
* @param databaseName
* The name for your database of up to 64 alphanumeric characters. If you do not provide a name, Amazon RDS
* doesn't create a database in the DB cluster you are creating.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDatabaseName(String databaseName) {
setDatabaseName(databaseName);
return this;
}
/**
* <p>
* The DB cluster identifier. This parameter is stored as a lowercase string.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
* </p>
*
* @param dBClusterIdentifier
* The DB cluster identifier. This parameter is stored as a lowercase string.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
*/
public void setDBClusterIdentifier(String dBClusterIdentifier) {
this.dBClusterIdentifier = dBClusterIdentifier;
}
/**
* <p>
* The DB cluster identifier. This parameter is stored as a lowercase string.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
* </p>
*
* @return The DB cluster identifier. This parameter is stored as a lowercase string.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
*/
public String getDBClusterIdentifier() {
return this.dBClusterIdentifier;
}
/**
* <p>
* The DB cluster identifier. This parameter is stored as a lowercase string.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
* </p>
*
* @param dBClusterIdentifier
* The DB cluster identifier. This parameter is stored as a lowercase string.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must contain from 1 to 63 letters, numbers, or hyphens.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't end with a hyphen or contain two consecutive hyphens.
* </p>
* </li>
* </ul>
* <p>
* Example: <code>my-cluster1</code>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDBClusterIdentifier(String dBClusterIdentifier) {
setDBClusterIdentifier(dBClusterIdentifier);
return this;
}
/**
* <p>
* The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a value, then
* the default DB cluster parameter group for the specified DB engine and version is used.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
* </ul>
*
* @param dBClusterParameterGroupName
* The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a
* value, then the default DB cluster parameter group for the specified DB engine and version is used. </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
*/
public void setDBClusterParameterGroupName(String dBClusterParameterGroupName) {
this.dBClusterParameterGroupName = dBClusterParameterGroupName;
}
/**
* <p>
* The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a value, then
* the default DB cluster parameter group for the specified DB engine and version is used.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
* </ul>
*
* @return The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a
* value, then the default DB cluster parameter group for the specified DB engine and version is used. </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
*/
public String getDBClusterParameterGroupName() {
return this.dBClusterParameterGroupName;
}
/**
* <p>
* The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a value, then
* the default DB cluster parameter group for the specified DB engine and version is used.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
* </ul>
*
* @param dBClusterParameterGroupName
* The name of the DB cluster parameter group to associate with this DB cluster. If you do not specify a
* value, then the default DB cluster parameter group for the specified DB engine and version is used. </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If supplied, must match the name of an existing DB cluster parameter group.
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDBClusterParameterGroupName(String dBClusterParameterGroupName) {
setDBClusterParameterGroupName(dBClusterParameterGroupName);
return this;
}
/**
* <p>
* A list of EC2 VPC security groups to associate with this DB cluster.
* </p>
*
* @return A list of EC2 VPC security groups to associate with this DB cluster.
*/
public java.util.List<String> getVpcSecurityGroupIds() {
if (vpcSecurityGroupIds == null) {
vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>();
}
return vpcSecurityGroupIds;
}
/**
* <p>
* A list of EC2 VPC security groups to associate with this DB cluster.
* </p>
*
* @param vpcSecurityGroupIds
* A list of EC2 VPC security groups to associate with this DB cluster.
*/
public void setVpcSecurityGroupIds(java.util.Collection<String> vpcSecurityGroupIds) {
if (vpcSecurityGroupIds == null) {
this.vpcSecurityGroupIds = null;
return;
}
this.vpcSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>(vpcSecurityGroupIds);
}
/**
* <p>
* A list of EC2 VPC security groups to associate with this DB cluster.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setVpcSecurityGroupIds(java.util.Collection)} or {@link #withVpcSecurityGroupIds(java.util.Collection)}
* if you want to override the existing values.
* </p>
*
* @param vpcSecurityGroupIds
* A list of EC2 VPC security groups to associate with this DB cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withVpcSecurityGroupIds(String... vpcSecurityGroupIds) {
if (this.vpcSecurityGroupIds == null) {
setVpcSecurityGroupIds(new com.amazonaws.internal.SdkInternalList<String>(vpcSecurityGroupIds.length));
}
for (String ele : vpcSecurityGroupIds) {
this.vpcSecurityGroupIds.add(ele);
}
return this;
}
/**
* <p>
* A list of EC2 VPC security groups to associate with this DB cluster.
* </p>
*
* @param vpcSecurityGroupIds
* A list of EC2 VPC security groups to associate with this DB cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withVpcSecurityGroupIds(java.util.Collection<String> vpcSecurityGroupIds) {
setVpcSecurityGroupIds(vpcSecurityGroupIds);
return this;
}
/**
* <p>
* A DB subnet group to associate with this DB cluster.
* </p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
* </p>
*
* @param dBSubnetGroupName
* A DB subnet group to associate with this DB cluster.</p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
*/
public void setDBSubnetGroupName(String dBSubnetGroupName) {
this.dBSubnetGroupName = dBSubnetGroupName;
}
/**
* <p>
* A DB subnet group to associate with this DB cluster.
* </p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
* </p>
*
* @return A DB subnet group to associate with this DB cluster.</p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
*/
public String getDBSubnetGroupName() {
return this.dBSubnetGroupName;
}
/**
* <p>
* A DB subnet group to associate with this DB cluster.
* </p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
* </p>
*
* @param dBSubnetGroupName
* A DB subnet group to associate with this DB cluster.</p>
* <p>
* Constraints: Must match the name of an existing DBSubnetGroup. Must not be default.
* </p>
* <p>
* Example: <code>mySubnetgroup</code>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDBSubnetGroupName(String dBSubnetGroupName) {
setDBSubnetGroupName(dBSubnetGroupName);
return this;
}
/**
* <p>
* The name of the database engine to be used for this DB cluster.
* </p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
* </p>
*
* @param engine
* The name of the database engine to be used for this DB cluster.</p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
*/
public void setEngine(String engine) {
this.engine = engine;
}
/**
* <p>
* The name of the database engine to be used for this DB cluster.
* </p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
* </p>
*
* @return The name of the database engine to be used for this DB cluster.</p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
*/
public String getEngine() {
return this.engine;
}
/**
* <p>
* The name of the database engine to be used for this DB cluster.
* </p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
* </p>
*
* @param engine
* The name of the database engine to be used for this DB cluster.</p>
* <p>
* Valid Values: <code>aurora</code> (for MySQL 5.6-compatible Aurora), <code>aurora-mysql</code> (for MySQL
* 5.7-compatible Aurora), and <code>aurora-postgresql</code>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEngine(String engine) {
setEngine(engine);
return this;
}
/**
* <p>
* The version number of the database engine to use.
* </p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora), use the
* following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible Aurora), use
* the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
* </p>
*
* @param engineVersion
* The version number of the database engine to use.</p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora),
* use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible
* Aurora), use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following
* command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
*/
public void setEngineVersion(String engineVersion) {
this.engineVersion = engineVersion;
}
/**
* <p>
* The version number of the database engine to use.
* </p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora), use the
* following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible Aurora), use
* the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
* </p>
*
* @return The version number of the database engine to use.</p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora),
* use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible
* Aurora), use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following
* command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
*/
public String getEngineVersion() {
return this.engineVersion;
}
/**
* <p>
* The version number of the database engine to use.
* </p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora), use the
* following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible Aurora), use
* the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
* </p>
*
* @param engineVersion
* The version number of the database engine to use.</p>
* <p>
* To list all of the available engine versions for <code>aurora</code> (for MySQL 5.6-compatible Aurora),
* use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-mysql</code> (for MySQL 5.7-compatible
* Aurora), use the following command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-mysql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* To list all of the available engine versions for <code>aurora-postgresql</code>, use the following
* command:
* </p>
* <p>
* <code>aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion"</code>
* </p>
* <p>
* <b>Aurora MySQL</b>
* </p>
* <p>
* Example: <code>5.6.10a</code>, <code>5.6.mysql_aurora.1.19.2</code>, <code>5.7.12</code>,
* <code>5.7.mysql_aurora.2.04.5</code>
* </p>
* <p>
* <b>Aurora PostgreSQL</b>
* </p>
* <p>
* Example: <code>9.6.3</code>, <code>10.7</code>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEngineVersion(String engineVersion) {
setEngineVersion(engineVersion);
return this;
}
/**
* <p>
* The port number on which the instances in the DB cluster accept connections.
* </p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
* </p>
*
* @param port
* The port number on which the instances in the DB cluster accept connections.</p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
*/
public void setPort(Integer port) {
this.port = port;
}
/**
* <p>
* The port number on which the instances in the DB cluster accept connections.
* </p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
* </p>
*
* @return The port number on which the instances in the DB cluster accept connections.</p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
*/
public Integer getPort() {
return this.port;
}
/**
* <p>
* The port number on which the instances in the DB cluster accept connections.
* </p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
* </p>
*
* @param port
* The port number on which the instances in the DB cluster accept connections.</p>
* <p>
* Default: <code>3306</code> if engine is set as aurora or <code>5432</code> if set to aurora-postgresql.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withPort(Integer port) {
setPort(port);
return this;
}
/**
* <p>
* The name of the master user for the DB cluster.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
* </ul>
*
* @param masterUsername
* The name of the master user for the DB cluster.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
*/
public void setMasterUsername(String masterUsername) {
this.masterUsername = masterUsername;
}
/**
* <p>
* The name of the master user for the DB cluster.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
* </ul>
*
* @return The name of the master user for the DB cluster.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
*/
public String getMasterUsername() {
return this.masterUsername;
}
/**
* <p>
* The name of the master user for the DB cluster.
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
* </ul>
*
* @param masterUsername
* The name of the master user for the DB cluster.</p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be 1 to 16 letters or numbers.
* </p>
* </li>
* <li>
* <p>
* First character must be a letter.
* </p>
* </li>
* <li>
* <p>
* Can't be a reserved word for the chosen database engine.
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withMasterUsername(String masterUsername) {
setMasterUsername(masterUsername);
return this;
}
/**
* <p>
* The password for the master database user. This password can contain any printable ASCII character except "/",
* """, or "@".
* </p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
* </p>
*
* @param masterUserPassword
* The password for the master database user. This password can contain any printable ASCII character except
* "/", """, or "@".</p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
*/
public void setMasterUserPassword(String masterUserPassword) {
this.masterUserPassword = masterUserPassword;
}
/**
* <p>
* The password for the master database user. This password can contain any printable ASCII character except "/",
* """, or "@".
* </p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
* </p>
*
* @return The password for the master database user. This password can contain any printable ASCII character except
* "/", """, or "@".</p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
*/
public String getMasterUserPassword() {
return this.masterUserPassword;
}
/**
* <p>
* The password for the master database user. This password can contain any printable ASCII character except "/",
* """, or "@".
* </p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
* </p>
*
* @param masterUserPassword
* The password for the master database user. This password can contain any printable ASCII character except
* "/", """, or "@".</p>
* <p>
* Constraints: Must contain from 8 to 41 characters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withMasterUserPassword(String masterUserPassword) {
setMasterUserPassword(masterUserPassword);
return this;
}
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified option group.
* </p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB cluster once
* it is associated with a DB cluster.
* </p>
*
* @param optionGroupName
* A value that indicates that the DB cluster should be associated with the specified option group.</p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB
* cluster once it is associated with a DB cluster.
*/
public void setOptionGroupName(String optionGroupName) {
this.optionGroupName = optionGroupName;
}
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified option group.
* </p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB cluster once
* it is associated with a DB cluster.
* </p>
*
* @return A value that indicates that the DB cluster should be associated with the specified option group.</p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB
* cluster once it is associated with a DB cluster.
*/
public String getOptionGroupName() {
return this.optionGroupName;
}
/**
* <p>
* A value that indicates that the DB cluster should be associated with the specified option group.
* </p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB cluster once
* it is associated with a DB cluster.
* </p>
*
* @param optionGroupName
* A value that indicates that the DB cluster should be associated with the specified option group.</p>
* <p>
* Permanent options can't be removed from an option group. The option group can't be removed from a DB
* cluster once it is associated with a DB cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withOptionGroupName(String optionGroupName) {
setOptionGroupName(optionGroupName);
return this;
}
/**
* <p>
* The daily time range during which automated backups are created if automated backups are enabled using the
* <code>BackupRetentionPeriod</code> parameter.
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the
* time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
* </ul>
*
* @param preferredBackupWindow
* The daily time range during which automated backups are created if automated backups are enabled using the
* <code>BackupRetentionPeriod</code> parameter. </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To
* see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
*/
public void setPreferredBackupWindow(String preferredBackupWindow) {
this.preferredBackupWindow = preferredBackupWindow;
}
/**
* <p>
* The daily time range during which automated backups are created if automated backups are enabled using the
* <code>BackupRetentionPeriod</code> parameter.
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the
* time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
* </ul>
*
* @return The daily time range during which automated backups are created if automated backups are enabled using
* the <code>BackupRetentionPeriod</code> parameter. </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To
* see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
*/
public String getPreferredBackupWindow() {
return this.preferredBackupWindow;
}
/**
* <p>
* The daily time range during which automated backups are created if automated backups are enabled using the
* <code>BackupRetentionPeriod</code> parameter.
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the
* time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
* </ul>
*
* @param preferredBackupWindow
* The daily time range during which automated backups are created if automated backups are enabled using the
* <code>BackupRetentionPeriod</code> parameter. </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To
* see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* Must be in the format <code>hh24:mi-hh24:mi</code>.
* </p>
* </li>
* <li>
* <p>
* Must be in Universal Coordinated Time (UTC).
* </p>
* </li>
* <li>
* <p>
* Must not conflict with the preferred maintenance window.
* </p>
* </li>
* <li>
* <p>
* Must be at least 30 minutes.
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withPreferredBackupWindow(String preferredBackupWindow) {
setPreferredBackupWindow(preferredBackupWindow);
return this;
}
/**
* <p>
* The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
* </p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring
* on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
* </p>
*
* @param preferredMaintenanceWindow
* The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region,
* occurring on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
*/
public void setPreferredMaintenanceWindow(String preferredMaintenanceWindow) {
this.preferredMaintenanceWindow = preferredMaintenanceWindow;
}
/**
* <p>
* The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
* </p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring
* on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
* </p>
*
* @return The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region,
* occurring on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
*/
public String getPreferredMaintenanceWindow() {
return this.preferredMaintenanceWindow;
}
/**
* <p>
* The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
* </p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring
* on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
* </p>
*
* @param preferredMaintenanceWindow
* The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).</p>
* <p>
* Format: <code>ddd:hh24:mi-ddd:hh24:mi</code>
* </p>
* <p>
* The default is a 30-minute window selected at random from an 8-hour block of time for each AWS Region,
* occurring on a random day of the week. To see the time blocks available, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_UpgradeDBInstance.Maintenance.html#AdjustingTheMaintenanceWindow.Aurora"
* > Adjusting the Preferred DB Cluster Maintenance Window</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
* <p>
* Valid Days: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
* </p>
* <p>
* Constraints: Minimum 30-minute window.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withPreferredMaintenanceWindow(String preferredMaintenanceWindow) {
setPreferredMaintenanceWindow(preferredMaintenanceWindow);
return this;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a read
* replica.
* </p>
*
* @param replicationSourceIdentifier
* The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a
* read replica.
*/
public void setReplicationSourceIdentifier(String replicationSourceIdentifier) {
this.replicationSourceIdentifier = replicationSourceIdentifier;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a read
* replica.
* </p>
*
* @return The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a
* read replica.
*/
public String getReplicationSourceIdentifier() {
return this.replicationSourceIdentifier;
}
/**
* <p>
* The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a read
* replica.
* </p>
*
* @param replicationSourceIdentifier
* The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this DB cluster is created as a
* read replica.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withReplicationSourceIdentifier(String replicationSourceIdentifier) {
setReplicationSourceIdentifier(replicationSourceIdentifier);
return this;
}
/**
* <p>
* Tags to assign to the DB cluster.
* </p>
*
* @return Tags to assign to the DB cluster.
*/
public java.util.List<Tag> getTags() {
if (tags == null) {
tags = new com.amazonaws.internal.SdkInternalList<Tag>();
}
return tags;
}
/**
* <p>
* Tags to assign to the DB cluster.
* </p>
*
* @param tags
* Tags to assign to the DB cluster.
*/
public void setTags(java.util.Collection<Tag> tags) {
if (tags == null) {
this.tags = null;
return;
}
this.tags = new com.amazonaws.internal.SdkInternalList<Tag>(tags);
}
/**
* <p>
* Tags to assign to the DB cluster.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setTags(java.util.Collection)} or {@link #withTags(java.util.Collection)} if you want to override the
* existing values.
* </p>
*
* @param tags
* Tags to assign to the DB cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withTags(Tag... tags) {
if (this.tags == null) {
setTags(new com.amazonaws.internal.SdkInternalList<Tag>(tags.length));
}
for (Tag ele : tags) {
this.tags.add(ele);
}
return this;
}
/**
* <p>
* Tags to assign to the DB cluster.
* </p>
*
* @param tags
* Tags to assign to the DB cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withTags(java.util.Collection<Tag> tags) {
setTags(tags);
return this;
}
/**
* <p>
* A value that indicates whether the DB cluster is encrypted.
* </p>
*
* @param storageEncrypted
* A value that indicates whether the DB cluster is encrypted.
*/
public void setStorageEncrypted(Boolean storageEncrypted) {
this.storageEncrypted = storageEncrypted;
}
/**
* <p>
* A value that indicates whether the DB cluster is encrypted.
* </p>
*
* @return A value that indicates whether the DB cluster is encrypted.
*/
public Boolean getStorageEncrypted() {
return this.storageEncrypted;
}
/**
* <p>
* A value that indicates whether the DB cluster is encrypted.
* </p>
*
* @param storageEncrypted
* A value that indicates whether the DB cluster is encrypted.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withStorageEncrypted(Boolean storageEncrypted) {
setStorageEncrypted(storageEncrypted);
return this;
}
/**
* <p>
* A value that indicates whether the DB cluster is encrypted.
* </p>
*
* @return A value that indicates whether the DB cluster is encrypted.
*/
public Boolean isStorageEncrypted() {
return this.storageEncrypted;
}
/**
* <p>
* The AWS KMS key identifier for an encrypted DB cluster.
* </p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a DB
* cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster, then you
* can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code> isn't
* specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set <code>KmsKeyId</code>
* to a KMS key ID that is valid in the destination AWS Region. This key is used to encrypt the read replica in that
* AWS Region.
* </p>
*
* @param kmsKeyId
* The AWS KMS key identifier for an encrypted DB cluster.</p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a
* DB cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster,
* then you can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code>
* isn't specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set
* <code>KmsKeyId</code> to a KMS key ID that is valid in the destination AWS Region. This key is used to
* encrypt the read replica in that AWS Region.
*/
public void setKmsKeyId(String kmsKeyId) {
this.kmsKeyId = kmsKeyId;
}
/**
* <p>
* The AWS KMS key identifier for an encrypted DB cluster.
* </p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a DB
* cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster, then you
* can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code> isn't
* specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set <code>KmsKeyId</code>
* to a KMS key ID that is valid in the destination AWS Region. This key is used to encrypt the read replica in that
* AWS Region.
* </p>
*
* @return The AWS KMS key identifier for an encrypted DB cluster.</p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating
* a DB cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB
* cluster, then you can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code>
* isn't specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set
* <code>KmsKeyId</code> to a KMS key ID that is valid in the destination AWS Region. This key is used to
* encrypt the read replica in that AWS Region.
*/
public String getKmsKeyId() {
return this.kmsKeyId;
}
/**
* <p>
* The AWS KMS key identifier for an encrypted DB cluster.
* </p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a DB
* cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster, then you
* can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code> isn't
* specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set <code>KmsKeyId</code>
* to a KMS key ID that is valid in the destination AWS Region. This key is used to encrypt the read replica in that
* AWS Region.
* </p>
*
* @param kmsKeyId
* The AWS KMS key identifier for an encrypted DB cluster.</p>
* <p>
* The KMS key identifier is the Amazon Resource Name (ARN) for the KMS encryption key. If you are creating a
* DB cluster with the same AWS account that owns the KMS encryption key used to encrypt the new DB cluster,
* then you can use the KMS key alias instead of the ARN for the KMS encryption key.
* </p>
* <p>
* If an encryption key isn't specified in <code>KmsKeyId</code>:
* </p>
* <ul>
* <li>
* <p>
* If <code>ReplicationSourceIdentifier</code> identifies an encrypted source, then Amazon RDS will use the
* encryption key used to encrypt the source. Otherwise, Amazon RDS will use your default encryption key.
* </p>
* </li>
* <li>
* <p>
* If the <code>StorageEncrypted</code> parameter is enabled and <code>ReplicationSourceIdentifier</code>
* isn't specified, then Amazon RDS will use your default encryption key.
* </p>
* </li>
* </ul>
* <p>
* AWS KMS creates the default encryption key for your AWS account. Your AWS account has a different default
* encryption key for each AWS Region.
* </p>
* <p>
* If you create a read replica of an encrypted DB cluster in another AWS Region, you must set
* <code>KmsKeyId</code> to a KMS key ID that is valid in the destination AWS Region. This key is used to
* encrypt the read replica in that AWS Region.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withKmsKeyId(String kmsKeyId) {
setKmsKeyId(kmsKeyId);
return this;
}
/**
* <p>
* A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to be called
* in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB cluster.
* </p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be executed
* in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB cluster in
* the destination AWS Region. This should refer to the same KMS key for both the <code>CreateDBCluster</code>
* action that is called in the destination AWS Region, and the action contained in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be copied.
* This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For example, if you
* are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests:
* Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing
* Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation
* that can be executed in the source AWS Region.
* </p>
* </note>
*
* @param preSignedUrl
* A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to be
* called in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB
* cluster.</p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be
* executed in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB
* cluster in the destination AWS Region. This should refer to the same KMS key for both the
* <code>CreateDBCluster</code> action that is called in the destination AWS Region, and the action contained
* in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be
* copied. This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For
* example, if you are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating
* Requests: Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing
* Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the
* operation that can be executed in the source AWS Region.
* </p>
*/
public void setPreSignedUrl(String preSignedUrl) {
this.preSignedUrl = preSignedUrl;
}
/**
* <p>
* A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to be called
* in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB cluster.
* </p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be executed
* in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB cluster in
* the destination AWS Region. This should refer to the same KMS key for both the <code>CreateDBCluster</code>
* action that is called in the destination AWS Region, and the action contained in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be copied.
* This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For example, if you
* are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests:
* Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing
* Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation
* that can be executed in the source AWS Region.
* </p>
* </note>
*
* @return A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to
* be called in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB
* cluster.</p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be
* executed in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB
* cluster in the destination AWS Region. This should refer to the same KMS key for both the
* <code>CreateDBCluster</code> action that is called in the destination AWS Region, and the action
* contained in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be
* copied. This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For
* example, if you are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating
* Requests: Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4
* Signing Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the
* operation that can be executed in the source AWS Region.
* </p>
*/
public String getPreSignedUrl() {
return this.preSignedUrl;
}
/**
* <p>
* A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to be called
* in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB cluster.
* </p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be executed
* in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB cluster in
* the destination AWS Region. This should refer to the same KMS key for both the <code>CreateDBCluster</code>
* action that is called in the destination AWS Region, and the action contained in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be copied.
* This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For example, if you
* are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating Requests:
* Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing
* Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the operation
* that can be executed in the source AWS Region.
* </p>
* </note>
*
* @param preSignedUrl
* A URL that contains a Signature Version 4 signed request for the <code>CreateDBCluster</code> action to be
* called in the source AWS Region where the DB cluster is replicated from. You only need to specify
* <code>PreSignedUrl</code> when you are performing cross-region replication from an encrypted DB
* cluster.</p>
* <p>
* The pre-signed URL must be a valid request for the <code>CreateDBCluster</code> API action that can be
* executed in the source AWS Region that contains the encrypted DB cluster to be copied.
* </p>
* <p>
* The pre-signed URL request must contain the following parameter values:
* </p>
* <ul>
* <li>
* <p>
* <code>KmsKeyId</code> - The AWS KMS key identifier for the key to use to encrypt the copy of the DB
* cluster in the destination AWS Region. This should refer to the same KMS key for both the
* <code>CreateDBCluster</code> action that is called in the destination AWS Region, and the action contained
* in the pre-signed URL.
* </p>
* </li>
* <li>
* <p>
* <code>DestinationRegion</code> - The name of the AWS Region that Aurora read replica will be created in.
* </p>
* </li>
* <li>
* <p>
* <code>ReplicationSourceIdentifier</code> - The DB cluster identifier for the encrypted DB cluster to be
* copied. This identifier must be in the Amazon Resource Name (ARN) format for the source AWS Region. For
* example, if you are copying an encrypted DB cluster from the us-west-2 AWS Region, then your
* <code>ReplicationSourceIdentifier</code> would look like Example:
* <code>arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster1</code>.
* </p>
* </li>
* </ul>
* <p>
* To learn how to generate a Signature Version 4 signed request, see <a
* href="https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html"> Authenticating
* Requests: Using Query Parameters (AWS Signature Version 4)</a> and <a
* href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html"> Signature Version 4 Signing
* Process</a>.
* </p>
* <note>
* <p>
* If you are using an AWS SDK tool or the AWS CLI, you can specify <code>SourceRegion</code> (or
* <code>--source-region</code> for the AWS CLI) instead of specifying <code>PreSignedUrl</code> manually.
* Specifying <code>SourceRegion</code> autogenerates a pre-signed URL that is a valid request for the
* operation that can be executed in the source AWS Region.
* </p>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withPreSignedUrl(String preSignedUrl) {
setPreSignedUrl(preSignedUrl);
return this;
}
/**
* <p>
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database
* accounts. By default, mapping is disabled.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM Database
* Authentication</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
*
* @param enableIAMDatabaseAuthentication
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to
* database accounts. By default, mapping is disabled.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM
* Database Authentication</a> in the <i>Amazon Aurora User Guide.</i>
*/
public void setEnableIAMDatabaseAuthentication(Boolean enableIAMDatabaseAuthentication) {
this.enableIAMDatabaseAuthentication = enableIAMDatabaseAuthentication;
}
/**
* <p>
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database
* accounts. By default, mapping is disabled.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM Database
* Authentication</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
*
* @return A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to
* database accounts. By default, mapping is disabled.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM
* Database Authentication</a> in the <i>Amazon Aurora User Guide.</i>
*/
public Boolean getEnableIAMDatabaseAuthentication() {
return this.enableIAMDatabaseAuthentication;
}
/**
* <p>
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database
* accounts. By default, mapping is disabled.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM Database
* Authentication</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
*
* @param enableIAMDatabaseAuthentication
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to
* database accounts. By default, mapping is disabled.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM
* Database Authentication</a> in the <i>Amazon Aurora User Guide.</i>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEnableIAMDatabaseAuthentication(Boolean enableIAMDatabaseAuthentication) {
setEnableIAMDatabaseAuthentication(enableIAMDatabaseAuthentication);
return this;
}
/**
* <p>
* A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database
* accounts. By default, mapping is disabled.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM Database
* Authentication</a> in the <i>Amazon Aurora User Guide.</i>
* </p>
*
* @return A value that indicates whether to enable mapping of AWS Identity and Access Management (IAM) accounts to
* database accounts. By default, mapping is disabled.</p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html"> IAM
* Database Authentication</a> in the <i>Amazon Aurora User Guide.</i>
*/
public Boolean isEnableIAMDatabaseAuthentication() {
return this.enableIAMDatabaseAuthentication;
}
/**
* <p>
* The target backtrack window, in seconds. To disable backtracking, set this value to 0.
* </p>
* <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
* </ul>
*
* @param backtrackWindow
* The target backtrack window, in seconds. To disable backtracking, set this value to 0. </p> <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
*/
public void setBacktrackWindow(Long backtrackWindow) {
this.backtrackWindow = backtrackWindow;
}
/**
* <p>
* The target backtrack window, in seconds. To disable backtracking, set this value to 0.
* </p>
* <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
* </ul>
*
* @return The target backtrack window, in seconds. To disable backtracking, set this value to 0. </p> <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
*/
public Long getBacktrackWindow() {
return this.backtrackWindow;
}
/**
* <p>
* The target backtrack window, in seconds. To disable backtracking, set this value to 0.
* </p>
* <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
* </ul>
*
* @param backtrackWindow
* The target backtrack window, in seconds. To disable backtracking, set this value to 0. </p> <note>
* <p>
* Currently, Backtrack is only supported for Aurora MySQL DB clusters.
* </p>
* </note>
* <p>
* Default: 0
* </p>
* <p>
* Constraints:
* </p>
* <ul>
* <li>
* <p>
* If specified, this value must be set to a number from 0 to 259,200 (72 hours).
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withBacktrackWindow(Long backtrackWindow) {
setBacktrackWindow(backtrackWindow);
return this;
}
/**
* <p>
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on
* the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @return The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list
* depend on the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
*/
public java.util.List<String> getEnableCloudwatchLogsExports() {
if (enableCloudwatchLogsExports == null) {
enableCloudwatchLogsExports = new com.amazonaws.internal.SdkInternalList<String>();
}
return enableCloudwatchLogsExports;
}
/**
* <p>
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on
* the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param enableCloudwatchLogsExports
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list
* depend on the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
*/
public void setEnableCloudwatchLogsExports(java.util.Collection<String> enableCloudwatchLogsExports) {
if (enableCloudwatchLogsExports == null) {
this.enableCloudwatchLogsExports = null;
return;
}
this.enableCloudwatchLogsExports = new com.amazonaws.internal.SdkInternalList<String>(enableCloudwatchLogsExports);
}
/**
* <p>
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on
* the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setEnableCloudwatchLogsExports(java.util.Collection)} or
* {@link #withEnableCloudwatchLogsExports(java.util.Collection)} if you want to override the existing values.
* </p>
*
* @param enableCloudwatchLogsExports
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list
* depend on the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEnableCloudwatchLogsExports(String... enableCloudwatchLogsExports) {
if (this.enableCloudwatchLogsExports == null) {
setEnableCloudwatchLogsExports(new com.amazonaws.internal.SdkInternalList<String>(enableCloudwatchLogsExports.length));
}
for (String ele : enableCloudwatchLogsExports) {
this.enableCloudwatchLogsExports.add(ele);
}
return this;
}
/**
* <p>
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list depend on
* the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param enableCloudwatchLogsExports
* The list of log types that need to be enabled for exporting to CloudWatch Logs. The values in the list
* depend on the DB engine being used. For more information, see <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch"
* >Publishing Database Logs to Amazon CloudWatch Logs</a> in the <i>Amazon Aurora User Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEnableCloudwatchLogsExports(java.util.Collection<String> enableCloudwatchLogsExports) {
setEnableCloudwatchLogsExports(enableCloudwatchLogsExports);
return this;
}
/**
* <p>
* The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.
* </p>
* <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL version
* 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use <code>provisioned</code> engine
* mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following sections in
* the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
* </ul>
*
* @param engineMode
* The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.</p> <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL
* version 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use
* <code>provisioned</code> engine mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following
* sections in the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
*/
public void setEngineMode(String engineMode) {
this.engineMode = engineMode;
}
/**
* <p>
* The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.
* </p>
* <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL version
* 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use <code>provisioned</code> engine
* mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following sections in
* the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
* </ul>
*
* @return The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.</p> <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL
* version 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use
* <code>provisioned</code> engine mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following
* sections in the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
*/
public String getEngineMode() {
return this.engineMode;
}
/**
* <p>
* The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.
* </p>
* <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL version
* 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use <code>provisioned</code> engine
* mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following sections in
* the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
* </ul>
*
* @param engineMode
* The DB engine mode of the DB cluster, either <code>provisioned</code>, <code>serverless</code>,
* <code>parallelquery</code>, <code>global</code>, or <code>multimaster</code>.</p> <note>
* <p>
* <code>global</code> engine mode only applies for global database clusters created with Aurora MySQL
* version 5.6.10a. For higher Aurora MySQL versions, the clusters in a global database use
* <code>provisioned</code> engine mode.
* </p>
* </note>
* <p>
* Limitations and requirements apply to some DB engine modes. For more information, see the following
* sections in the <i>Amazon Aurora User Guide</i>:
* </p>
* <ul>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations"
* > Limitations of Aurora Serverless</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations"
* > Limitations of Parallel Query</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations"
* > Requirements for Aurora Global Databases</a>
* </p>
* </li>
* <li>
* <p>
* <a href=
* "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations"
* > Limitations of Multi-Master Clusters</a>
* </p>
* </li>
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEngineMode(String engineMode) {
setEngineMode(engineMode);
return this;
}
/**
* <p>
* For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
* </p>
*
* @param scalingConfiguration
* For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
*/
public void setScalingConfiguration(ScalingConfiguration scalingConfiguration) {
this.scalingConfiguration = scalingConfiguration;
}
/**
* <p>
* For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
* </p>
*
* @return For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
*/
public ScalingConfiguration getScalingConfiguration() {
return this.scalingConfiguration;
}
/**
* <p>
* For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
* </p>
*
* @param scalingConfiguration
* For DB clusters in <code>serverless</code> DB engine mode, the scaling properties of the DB cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withScalingConfiguration(ScalingConfiguration scalingConfiguration) {
setScalingConfiguration(scalingConfiguration);
return this;
}
/**
* <p>
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when
* deletion protection is enabled. By default, deletion protection is disabled.
* </p>
*
* @param deletionProtection
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be
* deleted when deletion protection is enabled. By default, deletion protection is disabled.
*/
public void setDeletionProtection(Boolean deletionProtection) {
this.deletionProtection = deletionProtection;
}
/**
* <p>
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when
* deletion protection is enabled. By default, deletion protection is disabled.
* </p>
*
* @return A value that indicates whether the DB cluster has deletion protection enabled. The database can't be
* deleted when deletion protection is enabled. By default, deletion protection is disabled.
*/
public Boolean getDeletionProtection() {
return this.deletionProtection;
}
/**
* <p>
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when
* deletion protection is enabled. By default, deletion protection is disabled.
* </p>
*
* @param deletionProtection
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be
* deleted when deletion protection is enabled. By default, deletion protection is disabled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDeletionProtection(Boolean deletionProtection) {
setDeletionProtection(deletionProtection);
return this;
}
/**
* <p>
* A value that indicates whether the DB cluster has deletion protection enabled. The database can't be deleted when
* deletion protection is enabled. By default, deletion protection is disabled.
* </p>
*
* @return A value that indicates whether the DB cluster has deletion protection enabled. The database can't be
* deleted when deletion protection is enabled. By default, deletion protection is disabled.
*/
public Boolean isDeletionProtection() {
return this.deletionProtection;
}
/**
* <p>
* The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database cluster.
* </p>
*
* @param globalClusterIdentifier
* The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database
* cluster.
*/
public void setGlobalClusterIdentifier(String globalClusterIdentifier) {
this.globalClusterIdentifier = globalClusterIdentifier;
}
/**
* <p>
* The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database cluster.
* </p>
*
* @return The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database
* cluster.
*/
public String getGlobalClusterIdentifier() {
return this.globalClusterIdentifier;
}
/**
* <p>
* The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database cluster.
* </p>
*
* @param globalClusterIdentifier
* The global cluster ID of an Aurora cluster that becomes the primary cluster in the new global database
* cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withGlobalClusterIdentifier(String globalClusterIdentifier) {
setGlobalClusterIdentifier(globalClusterIdentifier);
return this;
}
/**
* <p>
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By default, the
* HTTP endpoint is disabled.
* </p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the Aurora
* Serverless DB cluster. You can also query your database from inside the RDS console with the query editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for Aurora
* Serverless</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param enableHttpEndpoint
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By
* default, the HTTP endpoint is disabled.</p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the
* Aurora Serverless DB cluster. You can also query your database from inside the RDS console with the query
* editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for
* Aurora Serverless</a> in the <i>Amazon Aurora User Guide</i>.
*/
public void setEnableHttpEndpoint(Boolean enableHttpEndpoint) {
this.enableHttpEndpoint = enableHttpEndpoint;
}
/**
* <p>
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By default, the
* HTTP endpoint is disabled.
* </p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the Aurora
* Serverless DB cluster. You can also query your database from inside the RDS console with the query editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for Aurora
* Serverless</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @return A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By
* default, the HTTP endpoint is disabled.</p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the
* Aurora Serverless DB cluster. You can also query your database from inside the RDS console with the query
* editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for
* Aurora Serverless</a> in the <i>Amazon Aurora User Guide</i>.
*/
public Boolean getEnableHttpEndpoint() {
return this.enableHttpEndpoint;
}
/**
* <p>
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By default, the
* HTTP endpoint is disabled.
* </p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the Aurora
* Serverless DB cluster. You can also query your database from inside the RDS console with the query editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for Aurora
* Serverless</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param enableHttpEndpoint
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By
* default, the HTTP endpoint is disabled.</p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the
* Aurora Serverless DB cluster. You can also query your database from inside the RDS console with the query
* editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for
* Aurora Serverless</a> in the <i>Amazon Aurora User Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEnableHttpEndpoint(Boolean enableHttpEndpoint) {
setEnableHttpEndpoint(enableHttpEndpoint);
return this;
}
/**
* <p>
* A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By default, the
* HTTP endpoint is disabled.
* </p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the Aurora
* Serverless DB cluster. You can also query your database from inside the RDS console with the query editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for Aurora
* Serverless</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @return A value that indicates whether to enable the HTTP endpoint for an Aurora Serverless DB cluster. By
* default, the HTTP endpoint is disabled.</p>
* <p>
* When enabled, the HTTP endpoint provides a connectionless web service API for running SQL queries on the
* Aurora Serverless DB cluster. You can also query your database from inside the RDS console with the query
* editor.
* </p>
* <p>
* For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/data-api.html">Using the Data API for
* Aurora Serverless</a> in the <i>Amazon Aurora User Guide</i>.
*/
public Boolean isEnableHttpEndpoint() {
return this.enableHttpEndpoint;
}
/**
* <p>
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default
* is not to copy them.
* </p>
*
* @param copyTagsToSnapshot
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The
* default is not to copy them.
*/
public void setCopyTagsToSnapshot(Boolean copyTagsToSnapshot) {
this.copyTagsToSnapshot = copyTagsToSnapshot;
}
/**
* <p>
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default
* is not to copy them.
* </p>
*
* @return A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The
* default is not to copy them.
*/
public Boolean getCopyTagsToSnapshot() {
return this.copyTagsToSnapshot;
}
/**
* <p>
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default
* is not to copy them.
* </p>
*
* @param copyTagsToSnapshot
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The
* default is not to copy them.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withCopyTagsToSnapshot(Boolean copyTagsToSnapshot) {
setCopyTagsToSnapshot(copyTagsToSnapshot);
return this;
}
/**
* <p>
* A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The default
* is not to copy them.
* </p>
*
* @return A value that indicates whether to copy all tags from the DB cluster to snapshots of the DB cluster. The
* default is not to copy them.
*/
public Boolean isCopyTagsToSnapshot() {
return this.copyTagsToSnapshot;
}
/**
* <p>
* The Active Directory directory ID to create the DB cluster in.
* </p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that connect to
* the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param domain
* The Active Directory directory ID to create the DB cluster in.</p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that
* connect to the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
*/
public void setDomain(String domain) {
this.domain = domain;
}
/**
* <p>
* The Active Directory directory ID to create the DB cluster in.
* </p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that connect to
* the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @return The Active Directory directory ID to create the DB cluster in.</p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that
* connect to the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
*/
public String getDomain() {
return this.domain;
}
/**
* <p>
* The Active Directory directory ID to create the DB cluster in.
* </p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that connect to
* the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
* </p>
*
* @param domain
* The Active Directory directory ID to create the DB cluster in.</p>
* <p>
* For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication to authenticate users that
* connect to the DB cluster. For more information, see <a
* href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html">Kerberos
* Authentication</a> in the <i>Amazon Aurora User Guide</i>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDomain(String domain) {
setDomain(domain);
return this;
}
/**
* <p>
* Specify the name of the IAM role to be used when making API calls to the Directory Service.
* </p>
*
* @param domainIAMRoleName
* Specify the name of the IAM role to be used when making API calls to the Directory Service.
*/
public void setDomainIAMRoleName(String domainIAMRoleName) {
this.domainIAMRoleName = domainIAMRoleName;
}
/**
* <p>
* Specify the name of the IAM role to be used when making API calls to the Directory Service.
* </p>
*
* @return Specify the name of the IAM role to be used when making API calls to the Directory Service.
*/
public String getDomainIAMRoleName() {
return this.domainIAMRoleName;
}
/**
* <p>
* Specify the name of the IAM role to be used when making API calls to the Directory Service.
* </p>
*
* @param domainIAMRoleName
* Specify the name of the IAM role to be used when making API calls to the Directory Service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withDomainIAMRoleName(String domainIAMRoleName) {
setDomainIAMRoleName(domainIAMRoleName);
return this;
}
/**
* <p>
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This parameter
* only applies to DB clusters that are secondary clusters in an Aurora global database. By default, Aurora
* disallows write operations for secondary clusters.
* </p>
*
* @param enableGlobalWriteForwarding
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This
* parameter only applies to DB clusters that are secondary clusters in an Aurora global database. By
* default, Aurora disallows write operations for secondary clusters.
*/
public void setEnableGlobalWriteForwarding(Boolean enableGlobalWriteForwarding) {
this.enableGlobalWriteForwarding = enableGlobalWriteForwarding;
}
/**
* <p>
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This parameter
* only applies to DB clusters that are secondary clusters in an Aurora global database. By default, Aurora
* disallows write operations for secondary clusters.
* </p>
*
* @return A value that indicates whether to enable write operations to be forwarded from this cluster to the
* primary cluster in an Aurora global database. The resulting changes are replicated back to this cluster.
* This parameter only applies to DB clusters that are secondary clusters in an Aurora global database. By
* default, Aurora disallows write operations for secondary clusters.
*/
public Boolean getEnableGlobalWriteForwarding() {
return this.enableGlobalWriteForwarding;
}
/**
* <p>
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This parameter
* only applies to DB clusters that are secondary clusters in an Aurora global database. By default, Aurora
* disallows write operations for secondary clusters.
* </p>
*
* @param enableGlobalWriteForwarding
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This
* parameter only applies to DB clusters that are secondary clusters in an Aurora global database. By
* default, Aurora disallows write operations for secondary clusters.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withEnableGlobalWriteForwarding(Boolean enableGlobalWriteForwarding) {
setEnableGlobalWriteForwarding(enableGlobalWriteForwarding);
return this;
}
/**
* <p>
* A value that indicates whether to enable write operations to be forwarded from this cluster to the primary
* cluster in an Aurora global database. The resulting changes are replicated back to this cluster. This parameter
* only applies to DB clusters that are secondary clusters in an Aurora global database. By default, Aurora
* disallows write operations for secondary clusters.
* </p>
*
* @return A value that indicates whether to enable write operations to be forwarded from this cluster to the
* primary cluster in an Aurora global database. The resulting changes are replicated back to this cluster.
* This parameter only applies to DB clusters that are secondary clusters in an Aurora global database. By
* default, Aurora disallows write operations for secondary clusters.
*/
public Boolean isEnableGlobalWriteForwarding() {
return this.enableGlobalWriteForwarding;
}
/**
* The region where the source instance is located.
*
* @param sourceRegion
* The region where the source instance is located.
*/
public void setSourceRegion(String sourceRegion) {
this.sourceRegion = sourceRegion;
}
/**
* The region where the source instance is located.
*
* @return The region where the source instance is located.
*/
public String getSourceRegion() {
return this.sourceRegion;
}
/**
* The region where the source instance is located.
*
* @param sourceRegion
* The region where the source instance is located.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateDBClusterRequest withSourceRegion(String sourceRegion) {
setSourceRegion(sourceRegion);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAvailabilityZones() != null)
sb.append("AvailabilityZones: ").append(getAvailabilityZones()).append(",");
if (getBackupRetentionPeriod() != null)
sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(",");
if (getCharacterSetName() != null)
sb.append("CharacterSetName: ").append(getCharacterSetName()).append(",");
if (getDatabaseName() != null)
sb.append("DatabaseName: ").append(getDatabaseName()).append(",");
if (getDBClusterIdentifier() != null)
sb.append("DBClusterIdentifier: ").append(getDBClusterIdentifier()).append(",");
if (getDBClusterParameterGroupName() != null)
sb.append("DBClusterParameterGroupName: ").append(getDBClusterParameterGroupName()).append(",");
if (getVpcSecurityGroupIds() != null)
sb.append("VpcSecurityGroupIds: ").append(getVpcSecurityGroupIds()).append(",");
if (getDBSubnetGroupName() != null)
sb.append("DBSubnetGroupName: ").append(getDBSubnetGroupName()).append(",");
if (getEngine() != null)
sb.append("Engine: ").append(getEngine()).append(",");
if (getEngineVersion() != null)
sb.append("EngineVersion: ").append(getEngineVersion()).append(",");
if (getPort() != null)
sb.append("Port: ").append(getPort()).append(",");
if (getMasterUsername() != null)
sb.append("MasterUsername: ").append(getMasterUsername()).append(",");
if (getMasterUserPassword() != null)
sb.append("MasterUserPassword: ").append(getMasterUserPassword()).append(",");
if (getOptionGroupName() != null)
sb.append("OptionGroupName: ").append(getOptionGroupName()).append(",");
if (getPreferredBackupWindow() != null)
sb.append("PreferredBackupWindow: ").append(getPreferredBackupWindow()).append(",");
if (getPreferredMaintenanceWindow() != null)
sb.append("PreferredMaintenanceWindow: ").append(getPreferredMaintenanceWindow()).append(",");
if (getReplicationSourceIdentifier() != null)
sb.append("ReplicationSourceIdentifier: ").append(getReplicationSourceIdentifier()).append(",");
if (getTags() != null)
sb.append("Tags: ").append(getTags()).append(",");
if (getStorageEncrypted() != null)
sb.append("StorageEncrypted: ").append(getStorageEncrypted()).append(",");
if (getKmsKeyId() != null)
sb.append("KmsKeyId: ").append(getKmsKeyId()).append(",");
if (getPreSignedUrl() != null)
sb.append("PreSignedUrl: ").append(getPreSignedUrl()).append(",");
if (getEnableIAMDatabaseAuthentication() != null)
sb.append("EnableIAMDatabaseAuthentication: ").append(getEnableIAMDatabaseAuthentication()).append(",");
if (getBacktrackWindow() != null)
sb.append("BacktrackWindow: ").append(getBacktrackWindow()).append(",");
if (getEnableCloudwatchLogsExports() != null)
sb.append("EnableCloudwatchLogsExports: ").append(getEnableCloudwatchLogsExports()).append(",");
if (getEngineMode() != null)
sb.append("EngineMode: ").append(getEngineMode()).append(",");
if (getScalingConfiguration() != null)
sb.append("ScalingConfiguration: ").append(getScalingConfiguration()).append(",");
if (getDeletionProtection() != null)
sb.append("DeletionProtection: ").append(getDeletionProtection()).append(",");
if (getGlobalClusterIdentifier() != null)
sb.append("GlobalClusterIdentifier: ").append(getGlobalClusterIdentifier()).append(",");
if (getEnableHttpEndpoint() != null)
sb.append("EnableHttpEndpoint: ").append(getEnableHttpEndpoint()).append(",");
if (getCopyTagsToSnapshot() != null)
sb.append("CopyTagsToSnapshot: ").append(getCopyTagsToSnapshot()).append(",");
if (getDomain() != null)
sb.append("Domain: ").append(getDomain()).append(",");
if (getDomainIAMRoleName() != null)
sb.append("DomainIAMRoleName: ").append(getDomainIAMRoleName()).append(",");
if (getEnableGlobalWriteForwarding() != null)
sb.append("EnableGlobalWriteForwarding: ").append(getEnableGlobalWriteForwarding()).append(",");
if (getSourceRegion() != null)
sb.append("SourceRegion: ").append(getSourceRegion());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateDBClusterRequest == false)
return false;
CreateDBClusterRequest other = (CreateDBClusterRequest) obj;
if (other.getAvailabilityZones() == null ^ this.getAvailabilityZones() == null)
return false;
if (other.getAvailabilityZones() != null && other.getAvailabilityZones().equals(this.getAvailabilityZones()) == false)
return false;
if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == null)
return false;
if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == false)
return false;
if (other.getCharacterSetName() == null ^ this.getCharacterSetName() == null)
return false;
if (other.getCharacterSetName() != null && other.getCharacterSetName().equals(this.getCharacterSetName()) == false)
return false;
if (other.getDatabaseName() == null ^ this.getDatabaseName() == null)
return false;
if (other.getDatabaseName() != null && other.getDatabaseName().equals(this.getDatabaseName()) == false)
return false;
if (other.getDBClusterIdentifier() == null ^ this.getDBClusterIdentifier() == null)
return false;
if (other.getDBClusterIdentifier() != null && other.getDBClusterIdentifier().equals(this.getDBClusterIdentifier()) == false)
return false;
if (other.getDBClusterParameterGroupName() == null ^ this.getDBClusterParameterGroupName() == null)
return false;
if (other.getDBClusterParameterGroupName() != null && other.getDBClusterParameterGroupName().equals(this.getDBClusterParameterGroupName()) == false)
return false;
if (other.getVpcSecurityGroupIds() == null ^ this.getVpcSecurityGroupIds() == null)
return false;
if (other.getVpcSecurityGroupIds() != null && other.getVpcSecurityGroupIds().equals(this.getVpcSecurityGroupIds()) == false)
return false;
if (other.getDBSubnetGroupName() == null ^ this.getDBSubnetGroupName() == null)
return false;
if (other.getDBSubnetGroupName() != null && other.getDBSubnetGroupName().equals(this.getDBSubnetGroupName()) == false)
return false;
if (other.getEngine() == null ^ this.getEngine() == null)
return false;
if (other.getEngine() != null && other.getEngine().equals(this.getEngine()) == false)
return false;
if (other.getEngineVersion() == null ^ this.getEngineVersion() == null)
return false;
if (other.getEngineVersion() != null && other.getEngineVersion().equals(this.getEngineVersion()) == false)
return false;
if (other.getPort() == null ^ this.getPort() == null)
return false;
if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
return false;
if (other.getMasterUsername() == null ^ this.getMasterUsername() == null)
return false;
if (other.getMasterUsername() != null && other.getMasterUsername().equals(this.getMasterUsername()) == false)
return false;
if (other.getMasterUserPassword() == null ^ this.getMasterUserPassword() == null)
return false;
if (other.getMasterUserPassword() != null && other.getMasterUserPassword().equals(this.getMasterUserPassword()) == false)
return false;
if (other.getOptionGroupName() == null ^ this.getOptionGroupName() == null)
return false;
if (other.getOptionGroupName() != null && other.getOptionGroupName().equals(this.getOptionGroupName()) == false)
return false;
if (other.getPreferredBackupWindow() == null ^ this.getPreferredBackupWindow() == null)
return false;
if (other.getPreferredBackupWindow() != null && other.getPreferredBackupWindow().equals(this.getPreferredBackupWindow()) == false)
return false;
if (other.getPreferredMaintenanceWindow() == null ^ this.getPreferredMaintenanceWindow() == null)
return false;
if (other.getPreferredMaintenanceWindow() != null && other.getPreferredMaintenanceWindow().equals(this.getPreferredMaintenanceWindow()) == false)
return false;
if (other.getReplicationSourceIdentifier() == null ^ this.getReplicationSourceIdentifier() == null)
return false;
if (other.getReplicationSourceIdentifier() != null && other.getReplicationSourceIdentifier().equals(this.getReplicationSourceIdentifier()) == false)
return false;
if (other.getTags() == null ^ this.getTags() == null)
return false;
if (other.getTags() != null && other.getTags().equals(this.getTags()) == false)
return false;
if (other.getStorageEncrypted() == null ^ this.getStorageEncrypted() == null)
return false;
if (other.getStorageEncrypted() != null && other.getStorageEncrypted().equals(this.getStorageEncrypted()) == false)
return false;
if (other.getKmsKeyId() == null ^ this.getKmsKeyId() == null)
return false;
if (other.getKmsKeyId() != null && other.getKmsKeyId().equals(this.getKmsKeyId()) == false)
return false;
if (other.getPreSignedUrl() == null ^ this.getPreSignedUrl() == null)
return false;
if (other.getPreSignedUrl() != null && other.getPreSignedUrl().equals(this.getPreSignedUrl()) == false)
return false;
if (other.getEnableIAMDatabaseAuthentication() == null ^ this.getEnableIAMDatabaseAuthentication() == null)
return false;
if (other.getEnableIAMDatabaseAuthentication() != null
&& other.getEnableIAMDatabaseAuthentication().equals(this.getEnableIAMDatabaseAuthentication()) == false)
return false;
if (other.getBacktrackWindow() == null ^ this.getBacktrackWindow() == null)
return false;
if (other.getBacktrackWindow() != null && other.getBacktrackWindow().equals(this.getBacktrackWindow()) == false)
return false;
if (other.getEnableCloudwatchLogsExports() == null ^ this.getEnableCloudwatchLogsExports() == null)
return false;
if (other.getEnableCloudwatchLogsExports() != null && other.getEnableCloudwatchLogsExports().equals(this.getEnableCloudwatchLogsExports()) == false)
return false;
if (other.getEngineMode() == null ^ this.getEngineMode() == null)
return false;
if (other.getEngineMode() != null && other.getEngineMode().equals(this.getEngineMode()) == false)
return false;
if (other.getScalingConfiguration() == null ^ this.getScalingConfiguration() == null)
return false;
if (other.getScalingConfiguration() != null && other.getScalingConfiguration().equals(this.getScalingConfiguration()) == false)
return false;
if (other.getDeletionProtection() == null ^ this.getDeletionProtection() == null)
return false;
if (other.getDeletionProtection() != null && other.getDeletionProtection().equals(this.getDeletionProtection()) == false)
return false;
if (other.getGlobalClusterIdentifier() == null ^ this.getGlobalClusterIdentifier() == null)
return false;
if (other.getGlobalClusterIdentifier() != null && other.getGlobalClusterIdentifier().equals(this.getGlobalClusterIdentifier()) == false)
return false;
if (other.getEnableHttpEndpoint() == null ^ this.getEnableHttpEndpoint() == null)
return false;
if (other.getEnableHttpEndpoint() != null && other.getEnableHttpEndpoint().equals(this.getEnableHttpEndpoint()) == false)
return false;
if (other.getCopyTagsToSnapshot() == null ^ this.getCopyTagsToSnapshot() == null)
return false;
if (other.getCopyTagsToSnapshot() != null && other.getCopyTagsToSnapshot().equals(this.getCopyTagsToSnapshot()) == false)
return false;
if (other.getDomain() == null ^ this.getDomain() == null)
return false;
if (other.getDomain() != null && other.getDomain().equals(this.getDomain()) == false)
return false;
if (other.getDomainIAMRoleName() == null ^ this.getDomainIAMRoleName() == null)
return false;
if (other.getDomainIAMRoleName() != null && other.getDomainIAMRoleName().equals(this.getDomainIAMRoleName()) == false)
return false;
if (other.getEnableGlobalWriteForwarding() == null ^ this.getEnableGlobalWriteForwarding() == null)
return false;
if (other.getEnableGlobalWriteForwarding() != null && other.getEnableGlobalWriteForwarding().equals(this.getEnableGlobalWriteForwarding()) == false)
return false;
if (other.getSourceRegion() == null ^ this.getSourceRegion() == null)
return false;
if (other.getSourceRegion() != null && other.getSourceRegion().equals(this.getSourceRegion()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAvailabilityZones() == null) ? 0 : getAvailabilityZones().hashCode());
hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode());
hashCode = prime * hashCode + ((getCharacterSetName() == null) ? 0 : getCharacterSetName().hashCode());
hashCode = prime * hashCode + ((getDatabaseName() == null) ? 0 : getDatabaseName().hashCode());
hashCode = prime * hashCode + ((getDBClusterIdentifier() == null) ? 0 : getDBClusterIdentifier().hashCode());
hashCode = prime * hashCode + ((getDBClusterParameterGroupName() == null) ? 0 : getDBClusterParameterGroupName().hashCode());
hashCode = prime * hashCode + ((getVpcSecurityGroupIds() == null) ? 0 : getVpcSecurityGroupIds().hashCode());
hashCode = prime * hashCode + ((getDBSubnetGroupName() == null) ? 0 : getDBSubnetGroupName().hashCode());
hashCode = prime * hashCode + ((getEngine() == null) ? 0 : getEngine().hashCode());
hashCode = prime * hashCode + ((getEngineVersion() == null) ? 0 : getEngineVersion().hashCode());
hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
hashCode = prime * hashCode + ((getMasterUsername() == null) ? 0 : getMasterUsername().hashCode());
hashCode = prime * hashCode + ((getMasterUserPassword() == null) ? 0 : getMasterUserPassword().hashCode());
hashCode = prime * hashCode + ((getOptionGroupName() == null) ? 0 : getOptionGroupName().hashCode());
hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode());
hashCode = prime * hashCode + ((getPreferredMaintenanceWindow() == null) ? 0 : getPreferredMaintenanceWindow().hashCode());
hashCode = prime * hashCode + ((getReplicationSourceIdentifier() == null) ? 0 : getReplicationSourceIdentifier().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
hashCode = prime * hashCode + ((getStorageEncrypted() == null) ? 0 : getStorageEncrypted().hashCode());
hashCode = prime * hashCode + ((getKmsKeyId() == null) ? 0 : getKmsKeyId().hashCode());
hashCode = prime * hashCode + ((getPreSignedUrl() == null) ? 0 : getPreSignedUrl().hashCode());
hashCode = prime * hashCode + ((getEnableIAMDatabaseAuthentication() == null) ? 0 : getEnableIAMDatabaseAuthentication().hashCode());
hashCode = prime * hashCode + ((getBacktrackWindow() == null) ? 0 : getBacktrackWindow().hashCode());
hashCode = prime * hashCode + ((getEnableCloudwatchLogsExports() == null) ? 0 : getEnableCloudwatchLogsExports().hashCode());
hashCode = prime * hashCode + ((getEngineMode() == null) ? 0 : getEngineMode().hashCode());
hashCode = prime * hashCode + ((getScalingConfiguration() == null) ? 0 : getScalingConfiguration().hashCode());
hashCode = prime * hashCode + ((getDeletionProtection() == null) ? 0 : getDeletionProtection().hashCode());
hashCode = prime * hashCode + ((getGlobalClusterIdentifier() == null) ? 0 : getGlobalClusterIdentifier().hashCode());
hashCode = prime * hashCode + ((getEnableHttpEndpoint() == null) ? 0 : getEnableHttpEndpoint().hashCode());
hashCode = prime * hashCode + ((getCopyTagsToSnapshot() == null) ? 0 : getCopyTagsToSnapshot().hashCode());
hashCode = prime * hashCode + ((getDomain() == null) ? 0 : getDomain().hashCode());
hashCode = prime * hashCode + ((getDomainIAMRoleName() == null) ? 0 : getDomainIAMRoleName().hashCode());
hashCode = prime * hashCode + ((getEnableGlobalWriteForwarding() == null) ? 0 : getEnableGlobalWriteForwarding().hashCode());
hashCode = prime * hashCode + ((getSourceRegion() == null) ? 0 : getSourceRegion().hashCode());
return hashCode;
}
@Override
public CreateDBClusterRequest clone() {
return (CreateDBClusterRequest) super.clone();
}
}
|
3e0730ea4141b8e695688caab110b85e771f4658
| 7,926 |
java
|
Java
|
component/l2-provider-impl-one/src/main/java/at/joma/apidesign/component/l2/provider/impl/ComponentProducer.java
|
joma74/apidesign
|
e00aa8d8efb943081eb905bd352b48de81a6800a
|
[
"Apache-2.0"
] | null | null | null |
component/l2-provider-impl-one/src/main/java/at/joma/apidesign/component/l2/provider/impl/ComponentProducer.java
|
joma74/apidesign
|
e00aa8d8efb943081eb905bd352b48de81a6800a
|
[
"Apache-2.0"
] | 22 |
2016-03-24T20:55:45.000Z
|
2016-04-30T20:49:13.000Z
|
component/l2-provider-impl-one/src/main/java/at/joma/apidesign/component/l2/provider/impl/ComponentProducer.java
|
joma74/apidesign
|
e00aa8d8efb943081eb905bd352b48de81a6800a
|
[
"Apache-2.0"
] | null | null | null | 37.742857 | 155 | 0.769114 | 3,037 |
package at.joma.apidesign.component.l2.provider.impl;
import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.enterprise.context.spi.Context;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Inject;
import javax.inject.Named;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import at.joma.apidesign.component.l1.client.api.config.IConfiguration;
import at.joma.apidesign.component.l2.client.api.IL2Component;
import at.joma.apidesign.component.l2.client.api.Omitting;
import at.joma.apidesign.component.l2.client.api.Sorting;
import at.joma.apidesign.component.l2.client.api.types.SortingDirection;
import at.joma.apidesign.component.l2.client.api.types.SortingOrder;
import at.joma.apidesign.component.l2.client.api.types.config.ConfiguredOptionsHolder;
import at.joma.apidesign.component.l2.provider.api.AsXML;
import at.joma.apidesign.component.l2.provider.api.builder.AsXMLByBuilder;
@Sorting
@Omitting
public class ComponentProducer {
private static final Logger LOG = LoggerFactory.getLogger(ComponentProducer.class);
@Inject
BeanManager beanManager;
@Inject
@Named(ComponentCacheHolder.CDI_NAME)
ComponentCacheHolder il2componentCacheHolderDONOTUSE;
protected static final Map<String, String> FORMATINFOS = new HashMap<>();
static {
FORMATINFOS.put(IConfiguration.FORMATINFO_KEY_FORMAT, "XML");
FORMATINFOS.put(IConfiguration.FORMATINFO_KEY_PRODUCER, ComponentProducer.class.getName());
}
private IL2Component createWithOptions( //
ComponentCacheHolder il2componentCacheHolder, //
Map<String, String> formatInfos, //
SortingOrder orderOption, //
SortingDirection directionOption, //
String[] omitByFieldNamesOption, //
Class<? extends Annotation>[] omitByFieldAnnotationsOption, //
Class<?>[] omitByFieldClassesOption//
) {
ConfiguredOptionsHolder configuredOptions = new ConfiguredOptionsHolder()//
.encloseFormatInfos(formatInfos)//
.encloseFormatInfos(Component.getFormatInfos())// else the
// reflective
// hashCode
// check for
// sameness
// fails
.with(orderOption)//
.with(directionOption)//
.with(Omitting.BYFIELDNAMES_OPTIONNAME, omitByFieldNamesOption)//
.with(Omitting.BYFIELDANNOTATIONS_OPTIONNAME, omitByFieldAnnotationsOption)//
.with(Omitting.BYFIELDCLASSES_OPTIONNAME, omitByFieldClassesOption);
Component iL2Component = il2componentCacheHolder.getIfPresent(configuredOptions);
if (iL2Component == null) {
synchronized (new Integer(configuredOptions.hashCode())) {
iL2Component = il2componentCacheHolder.getIfPresent(configuredOptions);
if (iL2Component == null) {
if (LOG.isDebugEnabled()) {
for (Entry<ConfiguredOptionsHolder, Component> entry : il2componentCacheHolder.getCache().asMap().entrySet()) {
ConfiguredOptionsHolder coh = entry.getKey();
LOG.debug(System.lineSeparator() + "ComponentCacheHolder Report for Key " + ConfiguredOptionsHolder.class.getSimpleName() + " having a hashcode of "
+ coh.hashCode() + " and represents a configuration of " + coh.printConfiguration());
}
}
iL2Component = new Component(configuredOptions);
ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
Validator validator = validatorFactory.getValidator();
Set<ConstraintViolation<Component>> constraintViolations = validator.validate(iL2Component);
if (!constraintViolations.isEmpty()) {
throw new ConstraintViolationException(Component.ERROR_MESSAGE_OPTIONSNOTVALID, constraintViolations);
}
try {
iL2Component.initializeSerializingInstance();
} catch (Exception e) {
LOG.error(e.getMessage(), e);
throw e;
}
il2componentCacheHolder.put(configuredOptions, iL2Component);
}
}
}
return iL2Component;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Produces
@AsXMLByBuilder
public IL2Component doProduceForBuilder(InjectionPoint ip) throws NoSuchMethodException {
AsXMLByBuilder configuration = (AsXMLByBuilder) ip.getQualifiers().iterator().next();
Bean<ComponentCacheHolder> targetedBean = (Bean<ComponentCacheHolder>) beanManager.resolve(beanManager.getBeans(ComponentCacheHolder.class));
Context beanContextOfConfig = beanManager.getContext(configuration.inScope());
CreationalContext creationalContextOfIP = beanManager.createCreationalContext(null);
ComponentCacheHolder il2componentCacheHolder = beanContextOfConfig.get(targetedBean, creationalContextOfIP);
return createWithOptions(//
il2componentCacheHolder, //
FORMATINFOS, //
configuration.sorting().order(), //
configuration.sorting().direction(), //
configuration.ommiting().byFieldNames(), //
configuration.ommiting().byFieldAnnotations(), //
configuration.ommiting().byFieldClasses() //
);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Produces
@AsXML
public IL2Component doProduceForCDI(InjectionPoint ip) throws NoSuchMethodException {
SortingOrder orderOption = this.getClass().getAnnotation(Sorting.class).order();
SortingDirection directionOption = this.getClass().getAnnotation(Sorting.class).direction();
String[] omitByFieldNamesOption = this.getClass().getAnnotation(Omitting.class).byFieldNames();
Class<? extends Annotation>[] omitByFieldAnnotationsOption = this.getClass().getAnnotation(Omitting.class).byFieldAnnotations();
Class<?>[] omitByFieldClassesOption = this.getClass().getAnnotation(Omitting.class).byFieldClasses();
Bean<ComponentCacheHolder> targetedBean = (Bean<ComponentCacheHolder>) beanManager.resolve(beanManager.getBeans(ComponentCacheHolder.class));
ComponentCacheHolder il2componentCacheHolder;
if (ip.getBean() != null) {
Context beanContextOfIP = beanManager.getContext(ip.getBean().getScope());
CreationalContext creationalContextOfIP = beanManager.createCreationalContext(ip.getBean());
il2componentCacheHolder = beanContextOfIP.get(targetedBean, creationalContextOfIP);
} else {
AsXML configuration = (AsXML) ip.getQualifiers().iterator().next();
Context beanContextOfConfig = beanManager.getContext(configuration.inScope());
CreationalContext creationalContextOfIP = beanManager.createCreationalContext(null);
il2componentCacheHolder = beanContextOfConfig.get(targetedBean, creationalContextOfIP);
}
Annotated annotated = ip.getAnnotated();
if (annotated != null) {
Sorting sortingAnnotation = annotated.getAnnotation(Sorting.class);
Omitting omittingAnnotation = annotated.getAnnotation(Omitting.class);
if (sortingAnnotation != null) {
orderOption = sortingAnnotation.order();
directionOption = sortingAnnotation.direction();
}
if (omittingAnnotation != null) {
omitByFieldNamesOption = omittingAnnotation.byFieldNames();
omitByFieldAnnotationsOption = omittingAnnotation.byFieldAnnotations();
omitByFieldClassesOption = omittingAnnotation.byFieldClasses();
}
}
return createWithOptions( //
il2componentCacheHolder, //
FORMATINFOS, //
orderOption, //
directionOption, //
omitByFieldNamesOption, //
omitByFieldAnnotationsOption, //
omitByFieldClassesOption //
);
}
public static Map<String, String> getFormatInfos() {
return Collections.unmodifiableMap(FORMATINFOS);
}
}
|
3e0732966b2533fa97e05a0d3386986005e5655e
| 4,926 |
java
|
Java
|
src/test/java/com/github/ka4ok85/wca/command/RemoveRecipientCommandTest.java
|
apocheau/watson-campaign-automation-spring
|
9d933cd38e05276574d6f5be8cbccb63bb7d9a4d
|
[
"MIT"
] | null | null | null |
src/test/java/com/github/ka4ok85/wca/command/RemoveRecipientCommandTest.java
|
apocheau/watson-campaign-automation-spring
|
9d933cd38e05276574d6f5be8cbccb63bb7d9a4d
|
[
"MIT"
] | null | null | null |
src/test/java/com/github/ka4ok85/wca/command/RemoveRecipientCommandTest.java
|
apocheau/watson-campaign-automation-spring
|
9d933cd38e05276574d6f5be8cbccb63bb7d9a4d
|
[
"MIT"
] | null | null | null | 38.732283 | 112 | 0.754828 | 3,038 |
package com.github.ka4ok85.wca.command;
import static org.junit.Assert.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Source;
import javax.xml.xpath.XPathExpressionException;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
import org.xmlunit.builder.DiffBuilder;
import org.xmlunit.builder.Input;
import org.xmlunit.diff.Diff;
import com.github.ka4ok85.wca.config.SpringConfig;
import com.github.ka4ok85.wca.options.RemoveRecipientOptions;
import com.github.ka4ok85.wca.response.RemoveRecipientResponse;
import com.github.ka4ok85.wca.response.ResponseContainer;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { SpringConfig.class })
public class RemoveRecipientCommandTest {
@Autowired
ApplicationContext context;
private String defaultRequest = String.join(System.getProperty("line.separator"),
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>", "<Envelope>", "<Body>", "<RemoveRecipient>",
"<LIST_ID>1</LIST_ID>", "<EMAIL>[email protected]</EMAIL>", "</RemoveRecipient>", "</Body>", "</Envelope>");
@Test(expected = NullPointerException.class)
public void testBuildXmlDoesNotAcceptNullOptions() {
RemoveRecipientCommand command = new RemoveRecipientCommand();
RemoveRecipientOptions options = null;
command.buildXmlRequest(options);
}
@Test
public void testBuildXmlDefaultRequest() {
// get XML from command
RemoveRecipientCommand command = new RemoveRecipientCommand();
RemoveRecipientOptions options = new RemoveRecipientOptions(1L);
options.setEmail("[email protected]");
command.buildXmlRequest(options);
String testString = command.getXML();
Source test = Input.fromString(testString).build();
// get control XML
String controlString = defaultRequest;
Source control = Input.fromString(controlString).build();
Diff myDiff = DiffBuilder.compare(control).withTest(test).ignoreWhitespace().checkForSimilar().build();
Assert.assertFalse(myDiff.toString(), myDiff.hasDifferences());
}
@Test(expected = RuntimeException.class)
public void testBuildXmlHonorsRequiresEmail() {
// get XML from command
RemoveRecipientCommand command = new RemoveRecipientCommand();
RemoveRecipientOptions options = new RemoveRecipientOptions(1L);
command.buildXmlRequest(options);
}
@Test
public void testBuildXmlHonorsColumns() {
// get XML from command
RemoveRecipientCommand command = new RemoveRecipientCommand();
RemoveRecipientOptions options = new RemoveRecipientOptions(1L);
options.setEmail("[email protected]");
Map<String, String> columns = new HashMap<String, String>();
columns.put("Email", "[email protected]");
columns.put("customerID", "123");
options.setColumns(columns);
command.buildXmlRequest(options);
String testString = command.getXML();
Source test = Input.fromString(testString).build();
// get control XML
String columnsString = "";
for (Entry<String, String> entry : columns.entrySet()) {
columnsString = columnsString + "<COLUMN><NAME>" + entry.getKey() + "</NAME><VALUE>" + entry.getValue()
+ "</VALUE></COLUMN>";
}
String controlString = defaultRequest.replace("<EMAIL>[email protected]</EMAIL>",
"<EMAIL>[email protected]</EMAIL>" + columnsString);
Source control = Input.fromString(controlString).build();
Diff myDiff = DiffBuilder.compare(control).withTest(test).ignoreWhitespace().checkForSimilar().build();
Assert.assertFalse(myDiff.toString(), myDiff.hasDifferences());
}
@Test
public void testReadResponse()
throws SAXException, IOException, ParserConfigurationException, XPathExpressionException {
RemoveRecipientCommand command = new RemoveRecipientCommand();
RemoveRecipientOptions options = new RemoveRecipientOptions(1L);
options.setEmail("[email protected]");
Element resultNode = DocumentBuilderFactory.newInstance().newDocumentBuilder()
.parse(new ByteArrayInputStream(
"<Envelope><Body><RESULT><SUCCESS>TRUE</SUCCESS></RESULT></Body></Envelope>".getBytes()))
.getDocumentElement();
ResponseContainer<RemoveRecipientResponse> responseContainer = command.readResponse(resultNode, options);
RemoveRecipientResponse response = responseContainer.getResposne();
assertEquals(response, null);
}
}
|
3e0732fa820de07283a6ed8f3954017d221e592b
| 254 |
java
|
Java
|
agent/agent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ConfigureLogging.java
|
johnoliver/ApplicationInsights-Java
|
cf05786142f192268c66ffc6ded13c4dfdc9be74
|
[
"MIT"
] | 1 |
2020-11-08T04:17:41.000Z
|
2020-11-08T04:17:41.000Z
|
agent/agent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ConfigureLogging.java
|
johnoliver/ApplicationInsights-Java
|
cf05786142f192268c66ffc6ded13c4dfdc9be74
|
[
"MIT"
] | null | null | null |
agent/agent-bootstrap/src/main/java/io/opentelemetry/javaagent/bootstrap/ConfigureLogging.java
|
johnoliver/ApplicationInsights-Java
|
cf05786142f192268c66ffc6ded13c4dfdc9be74
|
[
"MIT"
] | null | null | null | 28.222222 | 128 | 0.783465 | 3,039 |
package io.opentelemetry.javaagent.bootstrap;
// currently, the existence of this class and method trigger OpenTelemetry auto-instrumentation not to configure its own logging
public class ConfigureLogging {
public static void configure() {
}
}
|
3e0733b7245e336a8cab12cb38c2f99e0d3af141
| 665 |
java
|
Java
|
src/com/ExoMates/BungeeCord/API.java
|
Ekinoxx0/ExoMates---BungeeCord
|
5398c13e4db55ab91941995be10e3c31b2d41e0a
|
[
"MIT"
] | null | null | null |
src/com/ExoMates/BungeeCord/API.java
|
Ekinoxx0/ExoMates---BungeeCord
|
5398c13e4db55ab91941995be10e3c31b2d41e0a
|
[
"MIT"
] | null | null | null |
src/com/ExoMates/BungeeCord/API.java
|
Ekinoxx0/ExoMates---BungeeCord
|
5398c13e4db55ab91941995be10e3c31b2d41e0a
|
[
"MIT"
] | null | null | null | 25.576923 | 64 | 0.66015 | 3,040 |
package com.ExoMates.BungeeCord;
import net.md_5.bungee.api.config.ServerInfo;
public class API {
public static String ServerName = "ExoCraft";
public static String ServerPlatformName = "ExoCord";
public static String A1 = "➠";
public static String A2 = "▸";
public static ServerInfo MainHub = null;
public static ServerInfo MainGame = null;
public static String MessageOK = "§9[§2" + "✔" + "§9] §r";
public static String MessageNO = "§9[§c" + "✖" + "§9] §r";
public static String MessageGO = "§9[§1➠§9] §r";
public static String MessageLOAD = "§9[§5§l" + "🔄" + "§9] §r";
public static String noPerms = "§cTu n'as pas la permission !";
}
|
3e07342855309474d01af53eac25437bd4e04926
| 919 |
java
|
Java
|
rhymecity/src/main/java/com/fly/firefly/utils/PromptProgressDialog.java
|
imalpasha/flyfirefly
|
3af01f2963634c18227f9c5d276418ee86b9e324
|
[
"MIT"
] | null | null | null |
rhymecity/src/main/java/com/fly/firefly/utils/PromptProgressDialog.java
|
imalpasha/flyfirefly
|
3af01f2963634c18227f9c5d276418ee86b9e324
|
[
"MIT"
] | null | null | null |
rhymecity/src/main/java/com/fly/firefly/utils/PromptProgressDialog.java
|
imalpasha/flyfirefly
|
3af01f2963634c18227f9c5d276418ee86b9e324
|
[
"MIT"
] | null | null | null | 27.848485 | 71 | 0.624592 | 3,041 |
package com.fly.firefly.utils;
import android.app.ProgressDialog;
import android.content.Context;
/**
* Created by N0695 on 28/5/2015.
*/
public class PromptProgressDialog {
private static ProgressDialog progressDialog;
private static boolean isShowing = false;
public static void promptProgressDialog(Context context) {
if (!isShowing) {
progressDialog = new ProgressDialog(context);
progressDialog.setCancelable(false);
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setMessage("Loading");
progressDialog.show();
isShowing = true;
}
}
public static void dismissProgressDialog() {
if (isShowing) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
isShowing = false;
}
}
}
}
|
3e0734f369815d7d562ac275764df2787973b807
| 3,656 |
java
|
Java
|
src/frontend/factory/wizard/strategies/WizardStrategy.java
|
AlexDukeBlue/VoogaSalad
|
fbbf061ce443c9a9b08a77353bf73d390eb29008
|
[
"MIT"
] | null | null | null |
src/frontend/factory/wizard/strategies/WizardStrategy.java
|
AlexDukeBlue/VoogaSalad
|
fbbf061ce443c9a9b08a77353bf73d390eb29008
|
[
"MIT"
] | null | null | null |
src/frontend/factory/wizard/strategies/WizardStrategy.java
|
AlexDukeBlue/VoogaSalad
|
fbbf061ce443c9a9b08a77353bf73d390eb29008
|
[
"MIT"
] | null | null | null | 32.353982 | 80 | 0.72128 | 3,042 |
package frontend.factory.wizard.strategies;
import javafx.beans.binding.StringBinding;
import javafx.beans.property.ReadOnlyBooleanProperty;
import javafx.scene.layout.Region;
import util.polyglot_extended.ObservablePolyglot;
/**
* WizardStrategy is an interface to be used in the Strategy design pattern. It
* creates pages to prompt the user for information required to instantiate the
* object T. The idea is that other classes can switch out the
* WizardSelectionStrategies so that a single class can be used to instantiate
* many different types of objects, simply by switching the strategy.
*
* @author Dylan Peters
*
* @param <T>
* Type of Object that this WizardStrategy is being used to modify or
* instantiate.
*/
public interface WizardStrategy<T> {
/**
* Returns whether the strategy can go to the previous page and modify
* settings.
*
* @return ReadOnlyBooleanProperty boolean property describing whether to
* let the user go to a previous page.
*/
ReadOnlyBooleanProperty canPrevious();
/**
* Returns whether the strategy can go to the next page and modify settings.
*
* @return ReadOnlyBooleanProperty boolean property describing whether to
* let the user go to a next page.
*/
ReadOnlyBooleanProperty canNext();
/**
* Returns whether the strategy has all the information needed to
* instantiate an object.
*
* @return ReadOnlyBooleanProperty boolean property describing whether the
* strategy has all the information needed to instantiate an object.
*/
ReadOnlyBooleanProperty canFinish();
/**
* Returns a boolean property that tells other classes whether the strategy
* requests the wizard to cancel.
*
* @return true if the wizard should cancel
*/
ReadOnlyBooleanProperty requestsCancel();
/**
* Returns the object that displays to the user to allow the user to input
* settings.
*
* @return the object that displays to the user to allow the user to input
* settings.
*/
Region getNode();
/**
* Called to make the strategy go to the previous page to allow the user to
* change settings. If the canPrevious method returns false, this method
* will not do anything.
*/
void previous();
/**
* Called to make the strategy go to the next page to allow the user to
* change settings. If the canPrevious method returns false, this method
* will not do anything.
*/
void next();
/**
* Returns object of type T that has been successfully instantiated by this
* strategy. If the canFinish method is returning false, this will return
* null because it does not have enough information from the user to
* instantiate the object of type T.
*
* @return object of type T that has been successfully instantiated by this
* strategy. If the canFinish method is returning false, this will
* return null because it does not have enough information from the
* user to instantiate the object of type T.
*/
T finish();
/**
* Returns the ObservablePolyglot that the WizardStrategy uses to translate
* its text. This allows other classes to listen to changes in the polyglot
* or change the wizard's language.
*
* @return the ObservablePolyglot that the WizardStrategy uses to translate
* its text
*/
ObservablePolyglot getPolyglot();
/**
* Returns the title of the WizardStrategy in the form of a StringBinding,
* so that the Wizard can change the text of the string, and anything that
* uses it will automatically be updated.
*
* @return the title of the WizardStrategy
*/
StringBinding getTitle();
}
|
3e0735580232659196d7ff075d413c7785f44af2
| 732 |
java
|
Java
|
src/main/java/com/adobe/jenkins/github_pr_comment_build/GitHubPullRequestCommentCause.java
|
daniel-beck-bot/github-pr-comment-build-plugin
|
f87b146fc14a13b48e29d5213d65d31b2291a7c4
|
[
"MIT"
] | null | null | null |
src/main/java/com/adobe/jenkins/github_pr_comment_build/GitHubPullRequestCommentCause.java
|
daniel-beck-bot/github-pr-comment-build-plugin
|
f87b146fc14a13b48e29d5213d65d31b2291a7c4
|
[
"MIT"
] | 1 |
2022-02-21T09:12:23.000Z
|
2022-02-21T09:12:23.000Z
|
src/main/java/com/adobe/jenkins/github_pr_comment_build/GitHubPullRequestCommentCause.java
|
isabella232/github-pr-comment-build-plugin
|
b37955ec4fa96de33dd94be2414423db985b65a6
|
[
"MIT"
] | 1 |
2022-02-21T08:24:20.000Z
|
2022-02-21T08:24:20.000Z
| 23.612903 | 64 | 0.670765 | 3,043 |
package com.adobe.jenkins.github_pr_comment_build;
import hudson.model.Cause;
/**
* Created by saville on 10/13/2016.
*/
public final class GitHubPullRequestCommentCause extends Cause {
private final String commentUrl;
/**
* Constructor.
* @param commentUrl the URL for the GitHub comment
*/
public GitHubPullRequestCommentCause(String commentUrl) {
this.commentUrl = commentUrl;
}
@Override
public String getShortDescription() {
return "GitHub pull request comment";
}
/**
* Retrieves the URL for the GitHub comment for this cause.
* @return the URL for the GitHub comment
*/
public String getCommentUrl() {
return commentUrl;
}
}
|
3e0735836ce2eda79297759f7654a0f634c92c67
| 1,274 |
java
|
Java
|
coeey/kotlin/io/LinesSequence.java
|
ankurshukla1993/IOT-test
|
174c2f0f1b5ff7ef0ffb5eb29b6d68048b0af2b6
|
[
"Apache-2.0"
] | 1 |
2021-08-21T17:56:56.000Z
|
2021-08-21T17:56:56.000Z
|
coeey/kotlin/io/LinesSequence.java
|
ankurshukla1993/IOT-test
|
174c2f0f1b5ff7ef0ffb5eb29b6d68048b0af2b6
|
[
"Apache-2.0"
] | null | null | null |
coeey/kotlin/io/LinesSequence.java
|
ankurshukla1993/IOT-test
|
174c2f0f1b5ff7ef0ffb5eb29b6d68048b0af2b6
|
[
"Apache-2.0"
] | 1 |
2018-11-26T08:56:33.000Z
|
2018-11-26T08:56:33.000Z
| 50.96 | 652 | 0.734694 | 3,044 |
package kotlin.io;
import java.io.BufferedReader;
import java.util.Iterator;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u000f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00020\u0007H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlin/io/LinesSequence;", "Lkotlin/sequences/Sequence;", "", "reader", "Ljava/io/BufferedReader;", "(Ljava/io/BufferedReader;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 1, 7})
/* compiled from: ReadWrite.kt */
final class LinesSequence implements Sequence<String> {
private final BufferedReader reader;
public LinesSequence(@NotNull BufferedReader reader) {
Intrinsics.checkParameterIsNotNull(reader, "reader");
this.reader = reader;
}
@NotNull
public Iterator<String> iterator() {
return new LinesSequence$iterator$1(this);
}
}
|
3e07366cb9992f1f621ba65baa6c0abc01056aaa
| 1,844 |
java
|
Java
|
00-spring_test/src/main/java/prosayj/springtest/iocaop/service/assist/MyBeanPostProcessor.java
|
ProSayJ/spring-framework-5.2.9.RELEASE
|
7c8bac266fc90ab49eceed54da1504d2bd7a54d0
|
[
"Apache-2.0"
] | null | null | null |
00-spring_test/src/main/java/prosayj/springtest/iocaop/service/assist/MyBeanPostProcessor.java
|
ProSayJ/spring-framework-5.2.9.RELEASE
|
7c8bac266fc90ab49eceed54da1504d2bd7a54d0
|
[
"Apache-2.0"
] | null | null | null |
00-spring_test/src/main/java/prosayj/springtest/iocaop/service/assist/MyBeanPostProcessor.java
|
ProSayJ/spring-framework-5.2.9.RELEASE
|
7c8bac266fc90ab49eceed54da1504d2bd7a54d0
|
[
"Apache-2.0"
] | null | null | null | 34.792453 | 107 | 0.605748 | 3,045 |
package prosayj.springtest.iocaop.service.assist;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;
import prosayj.springtest.iocaop.service.UserService;
import prosayj.springtest.iocaop.service.impl.UserServiceImpl;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
/**
* TODO
*
* @author yangjian
* @date 2021-07-16 下午 01:03
* @since 1.0.0
*/
@Component(value = "myBeanPostProcessor")
public class MyBeanPostProcessor implements BeanPostProcessor {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
System.out.println(beanName + "---------->初始化之前");
if ("userService".equals(beanName)) {
((UserServiceImpl) bean).setBeanName("ProSayJ");
}
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
System.out.println(beanName + "---------->初始化之后");
if (bean instanceof UserService) {
return Proxy.newProxyInstance(
MyBeanPostProcessor.class.getClassLoader(),
bean.getClass().getInterfaces(),
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
//找切入点,判断是否需要执行 AOP 增强
System.out.println("userService 执行代理方法 开始");
Object invokeResult = method.invoke(bean, args);
System.out.println("userService 执行代理方法 结束");
return invokeResult;
}
});
}
return bean;
}
}
|
3e0736afc3ffc6d5f0c5a87e347fa75fae51b548
| 1,346 |
java
|
Java
|
TodoApp/app/src/main/java/com/example/dangfiztssi/todoapp/SplashActivity.java
|
DangFiztssi/T.O.D.O-app
|
528056a8436ae6a5ce6018e2b4c54c3f37bdc926
|
[
"MIT",
"Unlicense"
] | null | null | null |
TodoApp/app/src/main/java/com/example/dangfiztssi/todoapp/SplashActivity.java
|
DangFiztssi/T.O.D.O-app
|
528056a8436ae6a5ce6018e2b4c54c3f37bdc926
|
[
"MIT",
"Unlicense"
] | 1 |
2016-10-01T06:57:18.000Z
|
2016-10-01T10:13:37.000Z
|
TodoApp/app/src/main/java/com/example/dangfiztssi/todoapp/SplashActivity.java
|
DangFiztssi/T.O.D.O-app
|
528056a8436ae6a5ce6018e2b4c54c3f37bdc926
|
[
"MIT",
"Unlicense"
] | null | null | null | 29.911111 | 79 | 0.686478 | 3,046 |
package com.example.dangfiztssi.todoapp;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.DecelerateInterpolator;
import android.widget.ImageView;
import android.widget.TextView;
public class SplashActivity extends AppCompatActivity {
ImageView imgLogo;
TextView tvAppName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
imgLogo = (ImageView) findViewById(R.id.imgLogo);
tvAppName = (TextView) findViewById(R.id.tvAppName);
// android.app.ActionBar actionBar = getActionBar();
// actionBar.hide();
Animation animation = new AlphaAnimation(0,1);
animation.setInterpolator(new DecelerateInterpolator());
animation.setDuration(2000);
imgLogo.setAnimation(animation);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent i = new Intent(SplashActivity.this, MainActivity.class);
startActivity(i);
finish();
}
},3000);
}
}
|
3e07373c04c5ee671b00ec3c43aa6de4237bef28
| 635 |
java
|
Java
|
src/test/java/com/dragonfruit/dto/CsvTestDTO.java
|
jedcua/Parseux
|
3c9b6e6e746e9325d5d15f2883c74508a1044e76
|
[
"Apache-2.0"
] | 2 |
2017-06-24T17:39:43.000Z
|
2017-06-24T22:15:05.000Z
|
src/test/java/com/dragonfruit/dto/CsvTestDTO.java
|
jedcua/Parseux
|
3c9b6e6e746e9325d5d15f2883c74508a1044e76
|
[
"Apache-2.0"
] | 5 |
2017-06-24T14:51:57.000Z
|
2019-06-17T08:45:18.000Z
|
src/test/java/com/dragonfruit/dto/CsvTestDTO.java
|
jedcua/Parseux
|
3c9b6e6e746e9325d5d15f2883c74508a1044e76
|
[
"Apache-2.0"
] | null | null | null | 18.676471 | 61 | 0.606299 | 3,047 |
package com.dragonfruit.dto;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonPropertyOrder({"name", "age"})
public class CsvTestDTO {
private String name;
private Integer age;
public CsvTestDTO() {}
public CsvTestDTO(final String name, final Integer age) {
this();
this.name = name;
this.age = age;
}
public final String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public final Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
}
|
3e073759ba97dda7542af2b8deae01a11854339d
| 1,232 |
java
|
Java
|
java/algorithms/src/queue1/Test.java
|
novirael/school-codebase
|
efa2f99740d473a4121f62095dffe1b93f666819
|
[
"MIT"
] | 1 |
2017-04-02T07:10:34.000Z
|
2017-04-02T07:10:34.000Z
|
java/algorithms/src/queue1/Test.java
|
novirael/school-codebase
|
efa2f99740d473a4121f62095dffe1b93f666819
|
[
"MIT"
] | null | null | null |
java/algorithms/src/queue1/Test.java
|
novirael/school-codebase
|
efa2f99740d473a4121f62095dffe1b93f666819
|
[
"MIT"
] | null | null | null | 28.651163 | 101 | 0.676136 | 3,048 |
package queue1;
public class Test {
public static void main(String[] args) {
ListFifoQueue kolejka = new ListFifoQueue();
System.out.println("Utworzenie kolejki FIFO oraz sprawdzenie czy jest pusta: "+ kolejka.isEmpty());
System.out.println("\nWprowadzanie 6 elementow do kolejki: ");
kolejka.enqueue("pierwszy");
kolejka.enqueue("drugi");
kolejka.enqueue("trzeci");
kolejka.enqueue("czwarty");
kolejka.enqueue("piaty");
kolejka.enqueue("szosty");
System.out.println("\nWyswietlenie kolejki:");
kolejka.showQueue();
System.out.println("\nUsuniecie 4 elementow z kolejki:");
for (int i = 0; i < 4; i++) kolejka.dequeue();
kolejka.showQueue();
System.out.println("\nDodanie 5 elementow do kolejki: ");
for(int i = 0; i < 5; i++) kolejka.enqueue("klient "+ (i+1));
System.out.println("Wyswietlenie kolejki: ");
kolejka.showQueue();
System.out.println("\nWyczyszczenie kolejki: ");
System.out.println("Przed. Czy pusta: "+ kolejka.isEmpty());
System.out.println("Rozmiar: " + kolejka.size());
System.out.println("Czyszcze...");
kolejka.clear();
System.out.println("Po. Czy pusta: " + kolejka.isEmpty());
System.out.println("Rozmiar: "+ kolejka.size());
// Todo
}
}
|
3e0738518602bc6d0e4482bdbe14ec1b645f421d
| 1,316 |
java
|
Java
|
src/main/java/orange travels/MapGenerator.java
|
gopinathmennula/orange-travels
|
45198a55c0c309a41cd080ae690489b87b64f49d
|
[
"MIT"
] | null | null | null |
src/main/java/orange travels/MapGenerator.java
|
gopinathmennula/orange-travels
|
45198a55c0c309a41cd080ae690489b87b64f49d
|
[
"MIT"
] | null | null | null |
src/main/java/orange travels/MapGenerator.java
|
gopinathmennula/orange-travels
|
45198a55c0c309a41cd080ae690489b87b64f49d
|
[
"MIT"
] | null | null | null | 19.352941 | 105 | 0.694529 | 3,049 |
package orange travels;
import java.awt.Point;
import java.util.Random;
import de.slothsoft.challenger.core.Contributions;
import orange travels.contrib.ExampleContribution;
/**
* A generator for {@link Map}.
*
* @author Stef Schulz
* @since 1.0.0
*/
public class MapGenerator {
private Random rnd = new Random();
private int width = 20;
private int height = 15;
public Map generate() {
Map map = new Map(this.width, this.height);
int index = 0;
for (Contribution contrib : Contributions.fetchImplementations(ExampleContribution.class.getPackage(),
Contribution.class)) {
map.tiles[7][index++] = new ContributionTile(contrib);
}
return map;
}
private Point generateStartPoint(boolean[][] tiles) {
Point point = new Point();
do {
point.x = this.rnd.nextInt(this.width);
point.y = this.rnd.nextInt(this.height);
} while (tiles[point.x][point.y]);
return point;
}
public int getHeight() {
return this.height;
}
public MapGenerator height(int newHeight) {
setHeight(newHeight);
return this;
}
public void setHeight(int height) {
this.height = height;
}
public int getWidth() {
return this.width;
}
public MapGenerator width(int newWidth) {
setWidth(newWidth);
return this;
}
public void setWidth(int width) {
this.width = width;
}
}
|
3e0738b443959efac6f0f3215b25042e663b2037
| 6,876 |
java
|
Java
|
src/main/java/me/redraskal/survivethenight/game/Generator.java
|
redraskal/SurviveTheNight
|
d4adaa4e3e017a0fa1989615354873fdd6b82b8d
|
[
"MIT"
] | null | null | null |
src/main/java/me/redraskal/survivethenight/game/Generator.java
|
redraskal/SurviveTheNight
|
d4adaa4e3e017a0fa1989615354873fdd6b82b8d
|
[
"MIT"
] | 1 |
2020-07-31T11:41:58.000Z
|
2020-07-31T11:41:58.000Z
|
src/main/java/me/redraskal/survivethenight/game/Generator.java
|
JediMasterSoda/SurviveTheNight
|
d4adaa4e3e017a0fa1989615354873fdd6b82b8d
|
[
"MIT"
] | null | null | null | 42.708075 | 129 | 0.561227 | 3,050 |
package me.redraskal.survivethenight.game;
import lombok.Getter;
import lombok.Setter;
import me.redraskal.survivethenight.SurviveTheNight;
import me.redraskal.survivethenight.utils.NMSUtils;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import java.lang.reflect.InvocationTargetException;
/**
* Copyright (c) Redraskal 2017.
* <p>
* Please do not copy the code below unless you
* have permission to do so from me.
*/
public class Generator {
@Getter private final SurviveTheNight surviveTheNight;
@Getter private final Arena arena;
@Getter private final Block block;
@Getter @Setter private boolean running = false;
@Getter @Setter private int fuelPercentage = 0;
@Getter private final ArmorStand armorStand;
@Getter private final ArmorStand armorStand2;
public Generator(SurviveTheNight surviveTheNight, Arena arena, Block block) {
this.surviveTheNight = surviveTheNight;
this.arena = arena;
this.block = block;
this.armorStand = block.getWorld().spawn(block.getRelative(BlockFace.UP).getLocation().clone(), ArmorStand.class);
this.armorStand2 = block.getWorld().spawn(armorStand.getLocation().clone().subtract(0D, 0.3D, 0D), ArmorStand.class);
armorStand.setVisible(false);
armorStand.setBasePlate(false);
armorStand.setGravity(false);
armorStand.setSmall(true);
armorStand2.setVisible(false);
armorStand2.setBasePlate(false);
armorStand2.setGravity(false);
armorStand2.setSmall(true);
armorStand.setCustomName(ChatColor.translateAlternateColorCodes('&', "&c&l✖ &cGenerator &c&l✖"));
armorStand.setCustomNameVisible(true);
armorStand2.setCustomName(ChatColor.translateAlternateColorCodes('&', "&8▍▍▍▍▍▍▍▍▍▍▍▍▍▍"));
armorStand2.setCustomNameVisible(true);
}
public void fill(Player player) {
if(running) return;
if(player.getItemInHand() != null && this.getSurviveTheNight().getCustomItemManager()
.isSameItem(player.getItemInHand(), this.getSurviveTheNight()
.getCustomItemManager().getFuelCanItemStack())) {
if(player.getItemInHand().getAmount() == 1) {
player.getInventory().setItemInHand(new ItemStack(Material.AIR));
} else {
ItemStack itemStack = player.getItemInHand();
itemStack.setAmount(itemStack.getAmount()-1);
player.getInventory().setItemInHand(itemStack);
}
fuelPercentage+=25;
if(fuelPercentage >= 100) {
running = true;
block.getWorld().strikeLightningEffect(block.getLocation());
armorStand.remove();
armorStand2.setCustomName(ChatColor.translateAlternateColorCodes('&', "&a&l✓ &aGenerator &a&l✓"));
armorStand2.setCustomNameVisible(true);
int generatorsFilled = this.getArena().getGameRunnable().getGeneratorsFilled();
if(generatorsFilled < (this.getArena().getGeneratorsNeeded()+1)) {
this.getArena().getScoreboardMap().values().forEach(scoreboard -> {
if(generatorsFilled == this.getArena().getGeneratorsNeeded()) {
scoreboard.add("&aOpen", 7);
}
scoreboard.add("&f" + (this.getArena().getGeneratorsNeeded()-generatorsFilled) + " Generators until", 5);
scoreboard.update();
});
}
if(generatorsFilled == this.getArena().getGeneratorsNeeded()) {
//TODO: Open Exit Gates
}
try {
NMSUtils.clearTitle(player);
NMSUtils.sendTitleSubtitle(player, "&a+ 25%", "&2▍▍▍▍▍▍▍▍▍▍▍▍▍▍", 0, 20, 10);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
} else {
if(fuelPercentage == 25) {
armorStand2.setCustomName(ChatColor.translateAlternateColorCodes('&', "&c▍▍▍&8▍▍▍▍▍▍▍▍▍▍▍"));
armorStand2.setCustomNameVisible(true);
}
if(fuelPercentage == 50) {
armorStand2.setCustomName(ChatColor.translateAlternateColorCodes('&', "&e▍▍▍▍▍▍▍&8▍▍▍▍▍▍▍"));
armorStand2.setCustomNameVisible(true);
}
if(fuelPercentage == 75) {
armorStand2.setCustomName(ChatColor.translateAlternateColorCodes('&', "&2▍▍▍▍▍▍▍▍▍▍&8▍▍▍▍"));
armorStand2.setCustomNameVisible(true);
}
try {
NMSUtils.clearTitle(player);
NMSUtils.sendTitleSubtitle(player, "&a+ 25%", armorStand2.getCustomName(), 0, 20, 10);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
try {
NMSUtils.playSoundEffect(block.getLocation(), "mob.guardian.flop", 0.8f, 0.39f);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
}
}
}
|
3e07394122a8c299d69676c93cd94315a9d0c6e3
| 3,495 |
java
|
Java
|
OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/legacy/Fum.java
|
HerrB92/obp
|
31238554ec22a10e56892e987439ded36d671e1e
|
[
"MIT"
] | null | null | null |
OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/legacy/Fum.java
|
HerrB92/obp
|
31238554ec22a10e56892e987439ded36d671e1e
|
[
"MIT"
] | null | null | null |
OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/test/java/org/hibernate/test/legacy/Fum.java
|
HerrB92/obp
|
31238554ec22a10e56892e987439ded36d671e1e
|
[
"MIT"
] | 1 |
2022-01-06T09:05:56.000Z
|
2022-01-06T09:05:56.000Z
| 18.790323 | 72 | 0.695565 | 3,051 |
//$Id: Fum.java 4599 2004-09-26 05:18:27Z oneovthafew $
package org.hibernate.test.legacy;
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.hibernate.CallbackException;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.classic.Lifecycle;
public class Fum implements Lifecycle, Serializable {
private String fum;
private FumCompositeID id;
private Fum fo;
private Qux[] quxArray;
private Set friends;
private Calendar lastUpdated;
private String tString;
private short vid;
private short dupe;
private MapComponent mapComponent = new MapComponent();
public Fum() {}
public Fum(FumCompositeID id) throws SQLException, HibernateException {
this.id = id;
friends = new HashSet();
FumCompositeID fid = new FumCompositeID();
fid.setDate( Calendar.getInstance() );
fid.setShort( (short) ( id.short_ + 33 ) );
fid.setString( id.string_ + "dd" );
Fum f = new Fum();
f.id = fid;
f.fum="FRIEND";
friends.add(f);
}
public String getFum() {
return fum;
}
public void setFum(String fum) {
this.fum = fum;
}
public FumCompositeID getId() {
return id;
}
private void setId(FumCompositeID id) {
this.id = id;
}
public Fum getFo() {
return fo;
}
public void setFo(Fum fo) {
this.fo = fo;
}
public Qux[] getQuxArray() {
return quxArray;
}
public void setQuxArray(Qux[] quxArray) {
this.quxArray = quxArray;
}
public Set getFriends() {
return friends;
}
public void setFriends(Set friends) {
this.friends = friends;
}
public boolean onDelete(Session s) throws CallbackException {
if (friends==null) return false;
try {
Iterator iter = friends.iterator();
while ( iter.hasNext() ) {
s.delete( iter.next() );
}
}
catch (Exception e) {
throw new CallbackException(e);
}
return false;
}
public void onLoad(Session s, Serializable id) {
}
public boolean onSave(Session s) throws CallbackException {
if (friends==null) return false;
try {
Iterator iter = friends.iterator();
while ( iter.hasNext() ) {
s.save( iter.next() );
}
}
catch (Exception e) {
throw new CallbackException(e);
}
return false;
}
public boolean onUpdate(Session s) throws CallbackException {
return false;
}
public Calendar getLastUpdated() {
return lastUpdated;
}
public void setLastUpdated(Calendar calendar) {
lastUpdated = calendar;
}
public String getTString() {
return tString;
}
public void setTString(String string) {
tString = string;
}
public short getDupe() {
return dupe;
}
public void setDupe(short s) {
dupe = s;
}
public static final class MapComponent implements Serializable {
private Map fummap = new HashMap();
private Map stringmap = new HashMap();
private int count;
public Map getFummap() {
return fummap;
}
public void setFummap(Map mapcomponent) {
this.fummap = mapcomponent;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public Map getStringmap() {
return stringmap;
}
public void setStringmap(Map stringmap) {
this.stringmap = stringmap;
}
}
public MapComponent getMapComponent() {
return mapComponent;
}
public void setMapComponent(MapComponent mapComponent) {
this.mapComponent = mapComponent;
}
}
|
3e073a4f12f769d4e1e4e26a7fcc5871dd6af244
| 4,391 |
java
|
Java
|
appsearch/appsearch/src/main/java/androidx/appsearch/app/AppSearchBackend.java
|
mzgreen/androidx
|
8349a554dc7e405d296ac859280e44bd586bd6a1
|
[
"Apache-2.0"
] | null | null | null |
appsearch/appsearch/src/main/java/androidx/appsearch/app/AppSearchBackend.java
|
mzgreen/androidx
|
8349a554dc7e405d296ac859280e44bd586bd6a1
|
[
"Apache-2.0"
] | null | null | null |
appsearch/appsearch/src/main/java/androidx/appsearch/app/AppSearchBackend.java
|
mzgreen/androidx
|
8349a554dc7e405d296ac859280e44bd586bd6a1
|
[
"Apache-2.0"
] | null | null | null | 31.818841 | 100 | 0.690048 | 3,052 |
/*
* Copyright 2020 The Android Open Source Project
*
* 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 androidx.appsearch.app;
import androidx.annotation.NonNull;
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;
import java.io.Closeable;
import java.util.List;
/**
* Abstracts a storage system where {@link androidx.appsearch.annotation.AppSearchDocument}s can be
* placed and queried.
*
* All implementations of this interface must be thread safe.
* @hide
*/
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
public interface AppSearchBackend {
/** Returns {@code true} if this backend has been successfully initialized. */
boolean isInitialized();
/**
* Initializes this backend, or returns a successful {@link AppSearchResult} if it has already
* been initialized.
*/
@NonNull
AppSearchResult<Void> initialize();
/**
* Sets the schema being used by documents provided to the {@link #putDocuments} method.
*
* @see AppSearchManager#setSchema
*/
@NonNull
AppSearchResult<Void> setSchema(
@NonNull String databaseName, @NonNull AppSearchManager.SetSchemaRequest request);
/**
* Indexes documents into AppSearch.
*
* @see AppSearchManager#putDocuments
*/
@NonNull
AppSearchBatchResult<String, Void> putDocuments(
@NonNull String databaseName, @NonNull AppSearchManager.PutDocumentsRequest request);
/**
* Retrieves {@link GenericDocument}s by URI.
*
* @see AppSearchManager#getDocuments
*/
@NonNull
AppSearchBatchResult<String, GenericDocument> getDocuments(
@NonNull String databaseName, @NonNull AppSearchManager.GetDocumentsRequest request);
/**
* Searches a document based on a given query string.
* <p> This method is lightweight. The heavy work will be done in
* {@link BackendSearchResults#getNextPage()}.
* @see AppSearchManager#query
*/
@NonNull
BackendSearchResults query(
@NonNull String databaseName,
@NonNull String queryExpression,
@NonNull SearchSpec searchSpec);
/**
* Removes {@link GenericDocument}s from the index by URI.
*
* @see AppSearchManager#removeDocuments
*/
@NonNull
AppSearchBatchResult<String, Void> removeDocuments(
@NonNull String databaseName, @NonNull AppSearchManager.RemoveDocumentsRequest request);
/**
* Removes {@link GenericDocument}s from the index by schema type.
*
* @see AppSearchManager#removeByType
*/
@NonNull
AppSearchBatchResult<String, Void> removeByType(
@NonNull String databaseName, @NonNull List<String> schemaTypes);
/**
* Removes {@link GenericDocument}s from the index by namespace.
*
* @see AppSearchManager#removeByNamespace
*/
@NonNull
AppSearchBatchResult<String, Void> removeByNamespace(
@NonNull String databaseName, @NonNull List<String> namespaces);
/**
* Removes all documents owned by this database.
*
* @see AppSearchManager#removeAll
*/
@NonNull
AppSearchResult<Void> removeAll(@NonNull String databaseName);
/** Clears all documents, schemas and all other information owned by this app. */
@VisibleForTesting
@NonNull
AppSearchResult<Void> resetAllDatabases();
/**
* Abstracts a returned search results object, where the pagination of the results can be
* implemented.
*/
interface BackendSearchResults extends Closeable {
/**
* Fetches the next page of results of a previously executed query. Results can be empty if
* next-page token is invalid or all pages have been returned.
*/
@NonNull
AppSearchResult<List<SearchResults.Result>> getNextPage();
}
}
|
3e073ac2862deae92934f0115e4b6172b818f45c
| 530 |
java
|
Java
|
com/mysql/cj/xdevapi/InsertResultImpl.java
|
BantorSchwanzVor/plotscanner-leak
|
cbf130076159711d939affb4b0343c46c3466107
|
[
"MIT"
] | null | null | null |
com/mysql/cj/xdevapi/InsertResultImpl.java
|
BantorSchwanzVor/plotscanner-leak
|
cbf130076159711d939affb4b0343c46c3466107
|
[
"MIT"
] | null | null | null |
com/mysql/cj/xdevapi/InsertResultImpl.java
|
BantorSchwanzVor/plotscanner-leak
|
cbf130076159711d939affb4b0343c46c3466107
|
[
"MIT"
] | null | null | null | 27.894737 | 140 | 0.724528 | 3,053 |
package com.mysql.cj.xdevapi;
import com.mysql.cj.protocol.x.StatementExecuteOk;
public class InsertResultImpl extends UpdateResult implements InsertResult {
public InsertResultImpl(StatementExecuteOk ok) {
super(ok);
}
public Long getAutoIncrementValue() {
return this.ok.getLastInsertId();
}
}
/* Location: C:\Users\BSV\AppData\Local\Temp\Rar$DRa6216.20396\Preview\Preview.jar!\com\mysql\cj\xdevapi\InsertResultImpl.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/
|
3e073b69de03393b0cfe52f21bb0de9589d52849
| 203 |
java
|
Java
|
Practica12/Practica12/src/edu/upv/poo/Paintable.java
|
luisgerardoperalestorres/Arkanid_POO
|
58901c79870f60062093c0b8b949567945b1b337
|
[
"MIT"
] | null | null | null |
Practica12/Practica12/src/edu/upv/poo/Paintable.java
|
luisgerardoperalestorres/Arkanid_POO
|
58901c79870f60062093c0b8b949567945b1b337
|
[
"MIT"
] | null | null | null |
Practica12/Practica12/src/edu/upv/poo/Paintable.java
|
luisgerardoperalestorres/Arkanid_POO
|
58901c79870f60062093c0b8b949567945b1b337
|
[
"MIT"
] | null | null | null | 14.5 | 49 | 0.684729 | 3,054 |
package edu.upv.poo;
import java.awt.Graphics2D;
/**
* Representa un componente que se puede dibujar.
* @author luisroberto
*/
public interface Paintable {
void paint(Graphics2D g);
}
|
3e073bd1dfa189be3be09294129264a8774fa22c
| 882 |
java
|
Java
|
src/dynamic_programming/Boj6359.java
|
minuk8932/Algorithm_BaekJoon
|
9ba6e6669d7cdde622c7d527fef77c2035bf2528
|
[
"Apache-2.0"
] | 3 |
2019-05-10T08:23:46.000Z
|
2020-08-20T10:35:30.000Z
|
src/dynamic_programming/Boj6359.java
|
minuk8932/Algorithm_BaekJoon
|
9ba6e6669d7cdde622c7d527fef77c2035bf2528
|
[
"Apache-2.0"
] | null | null | null |
src/dynamic_programming/Boj6359.java
|
minuk8932/Algorithm_BaekJoon
|
9ba6e6669d7cdde622c7d527fef77c2035bf2528
|
[
"Apache-2.0"
] | 3 |
2019-05-15T13:06:50.000Z
|
2021-04-19T08:40:40.000Z
| 20.045455 | 75 | 0.575964 | 3,055 |
package dynamic_programming;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Boj6359 {
public static final String NEW_LINE = "\n";
public static void main(String[] args) throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
int T = Integer.parseInt(br.readLine());
int loop = T;
while(T > 0){
int N = Integer.parseInt(br.readLine());
boolean[] rooms = new boolean[N+1];
for(int i = 1; i < (N+1); i++){
for(int j = 1; i*j < (N+1); j++){
if(!rooms[i*j]){
rooms[i*j] = true;
}
else{
rooms[i*j] = false;
}
}
}
int cnt = 0;
for(int i = 1; i < (N+1); i++){
if(rooms[i]){
cnt++;
}
}
sb.append(cnt).append(NEW_LINE);
T--;
}
System.out.println(sb.toString());
}
}
|
3e073c6dd48dd0174a93051aef336700fee238a1
| 4,721 |
java
|
Java
|
callout/src/main/java/com/google/apigee/callouts/CalloutBase.java
|
DinoChiesa/Apigee-Csv-Shredder
|
18bad76148c1f4bc0574fdf12085383bd44ea1a4
|
[
"Apache-2.0"
] | null | null | null |
callout/src/main/java/com/google/apigee/callouts/CalloutBase.java
|
DinoChiesa/Apigee-Csv-Shredder
|
18bad76148c1f4bc0574fdf12085383bd44ea1a4
|
[
"Apache-2.0"
] | 1 |
2021-05-05T17:34:17.000Z
|
2021-05-05T17:34:17.000Z
|
callout/src/main/java/com/google/apigee/callouts/CalloutBase.java
|
DinoChiesa/ApigeeEdge-Csv-Shredder
|
18bad76148c1f4bc0574fdf12085383bd44ea1a4
|
[
"Apache-2.0"
] | 8 |
2017-10-17T16:50:31.000Z
|
2021-04-01T08:53:40.000Z
| 33.721429 | 102 | 0.679305 | 3,056 |
// CalloutBase.java
//
// Copyright 2018-2021 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
//
// https://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 com.google.apigee.callouts;
import com.apigee.flow.execution.ExecutionContext;
import com.apigee.flow.execution.ExecutionResult;
import com.apigee.flow.execution.spi.Execution;
import com.apigee.flow.message.MessageContext;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public abstract class CalloutBase implements Execution {
protected static final Pattern variableReferencePattern =
Pattern.compile("(.*?)\\{([^\\{\\} ]+?)\\}(.*?)");
private static final Pattern commonErrorPattern = Pattern.compile("^(.+?)[:;] (.+)$");
protected final ObjectMapper om = new ObjectMapper();
protected Map<String, String> properties; // read-only
public CalloutBase(Map properties) {
// convert the untyped Map to a generic map
Map<String, String> m = new HashMap<String, String>();
Iterator iterator = properties.keySet().iterator();
while (iterator.hasNext()) {
Object key = iterator.next();
Object value = properties.get(key);
if ((key instanceof String) && (value instanceof String)) {
m.put((String) key, (String) value);
}
}
this.properties = Collections.unmodifiableMap(m);
}
public abstract String getVarnamePrefix();
protected String varName(String s) {
return getVarnamePrefix() + "_" + s;
}
protected boolean getDebug() {
String flag = this.properties.get("debug");
return (flag!=null) && flag.equalsIgnoreCase("true");
}
protected boolean _getBooleanProperty(MessageContext msgCtxt, String propName, boolean defaultValue)
throws Exception {
String flag = this.properties.get(propName);
if (flag != null) flag = flag.trim();
if (flag == null || flag.equals("")) {
return defaultValue;
}
flag = resolveVariableReferences(flag, msgCtxt);
if (flag == null || flag.equals("")) {
return defaultValue;
}
return flag.equalsIgnoreCase("true");
}
protected String resolveVariableReferences(String spec, MessageContext msgCtxt) {
Matcher matcher = variableReferencePattern.matcher(spec);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
matcher.appendReplacement(sb, "");
sb.append(matcher.group(1));
String ref = matcher.group(2);
String[] parts = ref.split(":", 2);
Object v = msgCtxt.getVariable(parts[0]);
if (v != null) {
sb.append((String) v);
} else if (parts.length > 1) {
sb.append(parts[1]);
}
sb.append(matcher.group(3));
}
matcher.appendTail(sb);
return sb.toString();
}
protected static String getStackTraceAsString(Throwable t) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
return sw.toString();
}
protected void setExceptionVariables(Exception exc1, MessageContext msgCtxt) {
String error = exc1.toString().replaceAll("\n", " ");
msgCtxt.setVariable(varName("exception"), error);
Matcher matcher = commonErrorPattern.matcher(error);
if (matcher.matches()) {
msgCtxt.setVariable(varName("error"), matcher.group(2));
} else {
msgCtxt.setVariable(varName("error"), error);
}
}
public abstract ExecutionResult execute0(final MessageContext msgCtxt) throws Exception;
public ExecutionResult execute(final MessageContext msgCtxt, final ExecutionContext execContext) {
try {
return execute0(msgCtxt);
} catch (IllegalStateException exc1) {
setExceptionVariables(exc1, msgCtxt);
return ExecutionResult.ABORT;
} catch (Exception e) {
if (getDebug()) {
String stacktrace = getStackTraceAsString(e);
msgCtxt.setVariable(varName("stacktrace"), stacktrace);
}
setExceptionVariables(e, msgCtxt);
return ExecutionResult.ABORT;
}
}
}
|
3e073c8fc0ab4ab15823e874bfe9eb820a6f1799
| 507 |
java
|
Java
|
src/bean/Moto.java
|
AboubacarTH/Assurance
|
a6e995a4b7536de6d659d3cfe5295a9f1cf79b3a
|
[
"Apache-2.0"
] | null | null | null |
src/bean/Moto.java
|
AboubacarTH/Assurance
|
a6e995a4b7536de6d659d3cfe5295a9f1cf79b3a
|
[
"Apache-2.0"
] | null | null | null |
src/bean/Moto.java
|
AboubacarTH/Assurance
|
a6e995a4b7536de6d659d3cfe5295a9f1cf79b3a
|
[
"Apache-2.0"
] | null | null | null | 15.363636 | 52 | 0.577909 | 3,057 |
package bean;
public class Moto {
private long id, id_puissance;
public Moto() {
}
public Moto(long id, long id_puissance) {
this.id = id;
this.id_puissance = id_puissance;
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getId_puissance() {
return id_puissance;
}
public void setId_puissance(long id_puissance) {
this.id_puissance = id_puissance;
}
}
|
3e073cba2bb14163dd149a2e42e7d438485d1a1d
| 6,535 |
java
|
Java
|
cuppa/src/main/java/org/forgerock/cuppa/model/TestBlock.java
|
cuppa-framework/cuppa
|
eb1daec86772a1c096a3bac00fd48ca6add33058
|
[
"Apache-2.0",
"CC-BY-4.0"
] | 16 |
2016-01-31T15:05:47.000Z
|
2020-01-17T19:59:51.000Z
|
cuppa/src/main/java/org/forgerock/cuppa/model/TestBlock.java
|
cuppa-framework/cuppa
|
eb1daec86772a1c096a3bac00fd48ca6add33058
|
[
"Apache-2.0",
"CC-BY-4.0"
] | 102 |
2016-01-26T19:33:10.000Z
|
2021-05-26T11:42:15.000Z
|
cuppa/src/main/java/org/forgerock/cuppa/model/TestBlock.java
|
cuppa-framework/cuppa
|
eb1daec86772a1c096a3bac00fd48ca6add33058
|
[
"Apache-2.0",
"CC-BY-4.0"
] | 11 |
2016-03-22T14:18:02.000Z
|
2021-03-15T02:50:52.000Z
| 31.723301 | 116 | 0.599847 | 3,058 |
/*
* Copyright 2015-2016 ForgeRock AS.
*
* 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.forgerock.cuppa.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.forgerock.cuppa.functions.TestBlockFunction;
/**
* Models a collection of tests and/or nested test blocks.
*
* <p>A {@code TestBlock} is usually created by calling
* {@link org.forgerock.cuppa.Cuppa#describe(String, TestBlockFunction)} or
* {@link org.forgerock.cuppa.Cuppa#when(String, TestBlockFunction)} but can be constructed using
* {@link TestBlockBuilder}.</p>
*
* <p>{@code TestBlock}s form a tree, which together contain all the tests defined in the program. There is always a
* single root {@code TestBlock}, which has the type {@link TestBlockType#ROOT}.</p>
*
* <p>For example, the following test code</p>
*
* <pre>
* describe("a", () -> {
* beforeEach("a-be1", () -> {
*
* });
*
* it("a1");
*
* describe("b", () -> {
* it("b1");
* it("b3");
* });
* });
* </pre>
*
* <p>would result in a TestBlock tree of</p>
*
* <pre>
* root (TestBlock)
* |
* +-- a (TestBlock)
* |
* +-- a1 (Test)
* +-- a-be1 (Hook)
* +-- b (TestBlock)
* |
* +-- b1 (Test)
* +-- b2 (Test)
* </pre>
*
*/
public final class TestBlock {
/**
* The type of the test block.
*/
public final TestBlockType type;
/**
* Controls how the test block and its descendants behave.
*/
public final Behaviour behaviour;
/**
* The class that the test block was defined in.
*/
public final Class<?> testClass;
/**
* The description of the test block. Will be used for reporting.
*/
public final String description;
/**
* Nested test blocks.
*/
public final List<TestBlock> testBlocks;
/**
* Hooks defined by the test block.
*
* <p>This list does not contain hooks from any of the nested blocks.</p>
*/
public final List<Hook> hooks;
/**
* Tests defined by the test block.
*
* <p>This list does not contain tests from any of the nested blocks.</p>
*/
public final List<Test> tests;
/**
* The set of options applied to the test block.
*/
public final Options options;
// Package private. Use TestBlockBuilder.
TestBlock(TestBlockType type, Behaviour behaviour, Class<?> testClass, String description,
List<TestBlock> testBlocks, List<Hook> hooks, List<Test> tests, Options options) {
Objects.requireNonNull(type, "TestBlock must have a type");
Objects.requireNonNull(behaviour, "TestBlock must have a behaviour");
Objects.requireNonNull(testClass, "TestBlock must have a testClass");
Objects.requireNonNull(description, "TestBlock must have a description");
Objects.requireNonNull(testBlocks, "TestBlock must have testBlocks");
Objects.requireNonNull(hooks, "TestBlock must have hooks");
Objects.requireNonNull(tests, "TestBlock must have tests");
Objects.requireNonNull(options, "TestBlock must have options");
this.type = type;
this.behaviour = behaviour;
this.testClass = testClass;
this.description = description;
this.testBlocks = Collections.unmodifiableList(new ArrayList<>(testBlocks));
this.hooks = Collections.unmodifiableList(new ArrayList<>(hooks));
this.tests = Collections.unmodifiableList(new ArrayList<>(tests));
this.options = options;
}
/**
* Creates a {@link TestBlockBuilder} and initialises it's properties to this {@code TestBlock}.
* @return a {@link TestBlockBuilder}.
*/
public TestBlockBuilder toBuilder() {
return new TestBlockBuilder()
.setType(type)
.setBehaviour(behaviour)
.setTestClass(testClass)
.setDescription(description)
.setTestBlocks(new ArrayList<>(testBlocks))
.setHooks(new ArrayList<>(hooks))
.setTests(new ArrayList<>(tests))
.setOptions(options);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestBlock testBlock = (TestBlock) o;
return Objects.equals(type, testBlock.type)
&& Objects.equals(behaviour, testBlock.behaviour)
&& Objects.equals(testClass, testBlock.testClass)
&& Objects.equals(description, testBlock.description)
&& Objects.equals(testBlocks, testBlock.testBlocks)
&& Objects.equals(hooks, testBlock.hooks)
&& Objects.equals(tests, testBlock.tests)
&& Objects.equals(options, testBlock.options);
}
@Override
public int hashCode() {
return Objects.hash(type, behaviour, testClass, description, testBlocks, hooks, tests, options);
}
@Override
public String toString() {
return "TestBlock{"
+ "type=" + type
+ ", behaviour=" + behaviour
+ ", testClass=" + testClass
+ ", description='" + description + '\''
+ ", testBlocks=" + testBlocks
+ ", hooks=" + hooks
+ ", tests=" + tests
+ ", options=" + options
+ '}';
}
/**
* Get all the registered hooks of the given type, in the order they were defined.
*
* @param type The type of hook to filter on.
* @return An immutable list of hooks.
*/
public List<Hook> hooksOfType(HookType type) {
return hooks.stream()
.filter(h -> h.type == type)
.collect(Collectors.toList());
}
}
|
3e073d102d1c3a7a99f76feb0396c99e9da1f5e9
| 12,444 |
java
|
Java
|
src/testcases/net/cell_lang/Test_ForeignKey_BT12S.java
|
cell-lang/java
|
3c22a68c931422d45d6b020e09e040647ff453dd
|
[
"MIT"
] | 1 |
2019-04-05T19:37:37.000Z
|
2019-04-05T19:37:37.000Z
|
src/testcases/net/cell_lang/Test_ForeignKey_BT12S.java
|
cell-lang/java
|
3c22a68c931422d45d6b020e09e040647ff453dd
|
[
"MIT"
] | null | null | null |
src/testcases/net/cell_lang/Test_ForeignKey_BT12S.java
|
cell-lang/java
|
3c22a68c931422d45d6b020e09e040647ff453dd
|
[
"MIT"
] | null | null | null | 33.272727 | 118 | 0.530537 | 3,059 |
package net.cell_lang;
import java.util.Random;
import java.util.Arrays;
import java.math.BigInteger;
class Test_ForeignKey_BT12S {
static Random rand = new Random(0);
public static void run() {
boolean[][] done = new boolean[40][];
for (int i=0 ; i < 40 ; i++) {
done[i] = new boolean[40];
}
for (int r=1 ; r < 40 ; r++)
for (int r12=1 ; r12 < r ; r12++)
for (int r3=1 ; r3 < r ; r3++)
if (!done[r12][r3]) {
new Test_ForeignKey_BT12S().run(r12, r3, 10000);
done[r12][r3] = true;
}
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
ValueStore store12;
ValueStore store3;
SymBinaryTable source;
Sym12TernaryTable target;
ValueStoreUpdater storeUpdater12;
ValueStoreUpdater storeUpdater3;
SymBinaryTableUpdater sourceUpdater;
Sym12TernaryTableUpdater targetUpdater;
String[] values12;
String[] values3;
boolean[][] sourceBitmap;
boolean[][][] targetBitmap;
boolean[][] newSourceBitmap;
boolean[][][] newTargetBitmap;
int counter = 0;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
void run(int r12, int r3, int testCount) {
store12 = new ValueStore();
store3 = new ValueStore();
source = new SymBinaryTable(store12);
target = new Sym12TernaryTable(store12, store3);
storeUpdater12 = new ValueStoreUpdater(store12);
storeUpdater3 = new ValueStoreUpdater(store3);
sourceUpdater = new SymBinaryTableUpdater(source, storeUpdater12);
targetUpdater = new Sym12TernaryTableUpdater(target, storeUpdater12, storeUpdater3);
values12 = new String[r12];
values3 = new String[r3];
String charset = "abcdefghijklmnopqrstuvwxyz";
for (int i=0 ; i < r12 ; i++)
for ( ; ; ) {
int len = rand.nextInt(10);
char[] chars = new char[len];
for (int j=0 ; j < len ; j++)
chars[j] = charset.charAt(rand.nextInt(charset.length()));
String str = new String(chars);
boolean found = false;
for (int j=0 ; j < i ; j++)
if (str.equals(values12[j])) {
found = true;
break;
}
if (!found) {
values12[i] = str;
break;
}
}
for (int i=0 ; i < r3 ; i++)
for ( ; ; ) {
int len = 4 + rand.nextInt(4);
char[] chars = new char[len];
for (int j=0 ; j < len ; j++)
chars[j] = charset.charAt(rand.nextInt(charset.length()));
String tag = new String(chars);
String repr = String.format("(%d, %d)", rand.nextInt(1000), rand.nextInt(1000));
boolean found = false;
for (int j=0 ; j < i ; j++)
if (repr.equals(values3[j])) {
found = true;
break;
}
if (!found) {
values3[i] = repr;
break;
}
}
sourceBitmap = new boolean[r12][];
for (int i=0 ; i < r12 ; i++)
sourceBitmap[i] = new boolean[r12];
targetBitmap = new boolean[r12][][];
for (int i1=0 ; i1 < r12 ; i1++) {
targetBitmap[i1] = new boolean[r12][];
for (int i2=0 ; i2 < r12 ; i2++)
targetBitmap[i1][i2] = new boolean[r3];
}
int okCount = 0;
int okCountDeleted = 0;
int okCountInserted = 0;
int notOkCount = 0;
for (int _t=0 ; _t < testCount ; _t++) {
boolean dbgOn = false;
if (dbgOn)
System.out.printf("A - sourceUpdater.prepared = %s, targetUpdater.prepared = %s\n",
sourceUpdater.prepared ? "true" : "false", targetUpdater.prepared ? "true" : "false");
newSourceBitmap = new boolean[r12][];
for (int i=0 ; i < r12 ; i++)
newSourceBitmap[i] = Arrays.copyOf(sourceBitmap[i], sourceBitmap[i].length);
newTargetBitmap = new boolean[r12][][];
for (int i1=0 ; i1 < r12 ; i1++) {
newTargetBitmap[i1] = new boolean[r12][];
for (int i2=0 ; i2 < r12 ; i2++)
newTargetBitmap[i1][i2] = Arrays.copyOf(targetBitmap[i1][i2], targetBitmap[i1][i2].length);
}
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
for (int i3=0 ; i3 < r3 ; i3++) {
check(newSourceBitmap[i1][i2] == sourceBitmap[i1][i2]);
check(newTargetBitmap[i1][i2][i3] == targetBitmap[i1][i2][i3]);
}
if (dbgOn)
System.out.printf("-------------- %d ----------------\n", counter);
counter++;
if (dbgOn) {
System.out.printf("B - sourceUpdater.prepared = %s, targetUpdater.prepared = %s\n",
sourceUpdater.prepared ? "true" : "false", targetUpdater.prepared ? "true" : "false");
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
if (sourceBitmap[i1][i2])
if (newSourceBitmap[i1][i2])
System.out.printf("%d %d\n", i1, i2);
else
System.out.printf("%d %d -\n", i1, i2);
else if (newSourceBitmap[i1][i2])
System.out.printf("%d %d +\n", i1, i2);
System.out.println();
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
for (int i3=0 ; i3 < r3 ; i3++)
if (targetBitmap[i1][i2][i3])
if (newTargetBitmap[i1][i2][i3])
System.out.printf("%d %d %d\n", i1, i2, i3);
else
System.out.printf("%d %d %d -\n", i1, i2, i3);
else if (newTargetBitmap[i1][i2][i3])
System.out.printf("%d %d %d +\n", i1, i2, i3);
System.out.println();
System.out.println();
}
// Inserting and removing a few values at random in or from source
for (int i=0 ; i < rand.nextInt(20) ; i++) {
int idx1 = rand.nextInt(r12);
int idx2 = rand.nextInt(r12);
int surr1 = storeUpdater12.lookupOrInsertValue(Conversions.stringToObj(values12[idx1]));
int surr2 = storeUpdater12.lookupOrInsertValue(Conversions.stringToObj(values12[idx2]));
if (sourceBitmap[idx1][idx2]) {
sourceUpdater.delete(surr1, surr2);
if (dbgOn)
System.out.printf("S+ %d %d\n", idx1, idx2);
}
else {
sourceUpdater.insert(surr1, surr2);
if (dbgOn)
System.out.printf("S- %d %d\n", idx1, idx2);
}
newSourceBitmap[idx1][idx2] = !sourceBitmap[idx1][idx2];
if (idx1 != idx2)
newSourceBitmap[idx2][idx1] = newSourceBitmap[idx1][idx2];
}
// Inserting and removing a few values at random in or from target
for (int i=0 ; i < rand.nextInt(20) ; i++) {
int idx1 = rand.nextInt(r12);
int idx2 = rand.nextInt(r12);
int idx3 = rand.nextInt(r3);
int surr1 = storeUpdater12.lookupOrInsertValue(Conversions.stringToObj(values12[idx1]));
int surr2 = storeUpdater12.lookupOrInsertValue(Conversions.stringToObj(values12[idx2]));
int surr3 = storeUpdater3.lookupOrInsertValue(Conversions.convertText(values3[idx3]));
if (targetBitmap[idx1][idx2][idx3]) {
targetUpdater.delete(surr1, surr2, surr3);
if (dbgOn)
System.out.printf("T+ %d %d %d\n", idx1, idx2, idx3);
}
else {
targetUpdater.insert(surr1, surr2, surr3);
if (dbgOn)
System.out.printf("T- %d %d %d\n", idx1, idx2, idx3);
}
newTargetBitmap[idx1][idx2][idx3] = !targetBitmap[idx1][idx2][idx3];
if (idx1 != idx2)
newTargetBitmap[idx2][idx1][idx3] = newTargetBitmap[idx1][idx2][idx3];
}
boolean ok = true;
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
if (newSourceBitmap[i1][i2]) {
boolean found = false;
for (int i3=0 ; i3 < r3 ; i3++)
if (newTargetBitmap[i1][i2][i3]) {
found = true;
break;
}
if (!found) {
ok = false;
break;
}
}
if (dbgOn)
System.out.printf("C - sourceUpdater.prepared = %s, targetUpdater.prepared = %s\n",
sourceUpdater.prepared ? "true" : "false", targetUpdater.prepared ? "true" : "false");
boolean debugIt = sourceUpdater.checkForeignKeys_12(targetUpdater) != ok;
if (debugIt) {
System.out.printf("ERROR: _t = %d, counter = %d, r12 = %d, r3 = %d, ok = %s, okCount = %d, notOkCount = %d\n",
_t, counter, r12, r3, ok ? "true" : "false", okCount, notOkCount);
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
if (sourceBitmap[i1][i2])
if (newSourceBitmap[i1][i2])
System.out.printf("%d %d\n", i1, i2);
else
System.out.printf("%d %d -\n", i1, i2);
else if (newSourceBitmap[i1][i2])
System.out.printf("%d %d +\n", i1, i2);
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
for (int i3=0 ; i3 < r3 ; i3++)
if (targetBitmap[i1][i2][i3])
if (newTargetBitmap[i1][i2][i3])
System.out.printf("%d %d %d\n", i1, i2, i3);
else
System.out.printf("%d %d %d -\n", i1, i2, i3);
else if (newTargetBitmap[i1][i2][i3])
System.out.printf("%d %d %d +\n", i1, i2, i3);
ok = sourceUpdater.checkForeignKeys_12(targetUpdater);
System.exit(1);
}
if (ok) {
int deletedFromSource = 0;
int insertedIntoSource = 0;
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++) {
if (sourceBitmap[i1][i2] & !newSourceBitmap[i1][i2])
deletedFromSource++;
if (!sourceBitmap[i1][i2] & newSourceBitmap[i1][i2])
insertedIntoSource++;
}
if (deletedFromSource > 0)
okCountDeleted++;
if (insertedIntoSource > 0)
okCountInserted++;
if (deletedFromSource > 0 | insertedIntoSource > 0)
okCount++;
sourceBitmap = newSourceBitmap;
targetBitmap = newTargetBitmap;
newSourceBitmap = null;
newTargetBitmap = null;
storeUpdater12.apply();
storeUpdater3.apply();
sourceUpdater.apply();
targetUpdater.apply();
sourceUpdater.finish();
targetUpdater.finish();
for (int i1=0 ; i1 < r12 ; i1++)
for (int i2=0 ; i2 < r12 ; i2++)
for (int i3=0 ; i3 < r3 ; i3++) {
boolean inSource = sourceBitmap[i1][i2];
boolean inTarget = targetBitmap[i1][i2][i3];
int surr1 = store12.valueToSurr(Conversions.stringToObj(values12[i1]));
int surr2 = store12.valueToSurr(Conversions.stringToObj(values12[i2]));
int surr3 = store3.valueToSurr(Conversions.convertText(values3[i3]));
if (surr1 == -1 | surr2 == -1) {
// If either the first or the second argument is not in the
// corresponding value store, then neither table can contain it
check(!inSource & !inTarget);
continue;
}
if (surr3 == -1) {
// If the third argument is not in the corresponding value store,
// then the entry cannot appear in the target relation
check(!inTarget);
continue;
}
check(target.contains(surr1, surr2, surr3) == inTarget);
check(target.contains(surr2, surr1, surr3) == inTarget);
check(source.contains(surr1, surr2) == inSource);
check(source.contains(surr2, surr1) == inSource);
}
}
else {
notOkCount++;
}
storeUpdater12.reset();
storeUpdater3.reset();
sourceUpdater.reset();
targetUpdater.reset();
if (dbgOn)
System.out.printf("C - sourceUpdater.prepared = %s, targetUpdater.prepared = %s\n",
sourceUpdater.prepared ? "true" : "false", targetUpdater.prepared ? "true" : "false");
}
System.out.printf("r12 = %d, r3 = %d", r12, r3);
System.out.printf(", ok: %d - %d - %d, not ok: %d", okCount, okCountDeleted, okCountInserted, notOkCount);
System.out.printf(", size: %d -> %d\n", source.size(), target.size());
System.out.println();
}
void check(boolean cond) {
if (!cond)
throw new RuntimeException();
}
}
|
3e073d8ae9d791ac085528f60e9a4a93edfab74e
| 108 |
java
|
Java
|
src/main/java/com/google/devrel/training/enumeration/TypeOfSession.java
|
soulhave/03-Udacity-lab
|
478b3d8adcec815ae1d96fe3a44c401e0ff99a93
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/google/devrel/training/enumeration/TypeOfSession.java
|
soulhave/03-Udacity-lab
|
478b3d8adcec815ae1d96fe3a44c401e0ff99a93
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/google/devrel/training/enumeration/TypeOfSession.java
|
soulhave/03-Udacity-lab
|
478b3d8adcec815ae1d96fe3a44c401e0ff99a93
|
[
"Apache-2.0"
] | null | null | null | 18 | 47 | 0.796296 | 3,060 |
package com.google.devrel.training.enumeration;
public enum TypeOfSession {
LECTURE, KEYNOTE, WORKSHOP;
}
|
3e073da402311d20008cd1916f6211a6702231b6
| 2,586 |
java
|
Java
|
platform-dao/src/main/java/ua/com/fielden/platform/entity/query/metadata/PropertyColumn.java
|
fieldenms/
|
4efd3b2475877d434a57cbba638b711df95748e7
|
[
"MIT"
] | 16 |
2017-03-22T05:42:26.000Z
|
2022-01-17T22:38:38.000Z
|
platform-dao/src/main/java/ua/com/fielden/platform/entity/query/metadata/PropertyColumn.java
|
fieldenms/
|
4efd3b2475877d434a57cbba638b711df95748e7
|
[
"MIT"
] | 647 |
2017-03-21T07:47:44.000Z
|
2022-03-31T13:03:47.000Z
|
platform-dao/src/main/java/ua/com/fielden/platform/entity/query/metadata/PropertyColumn.java
|
fieldenms/
|
4efd3b2475877d434a57cbba638b711df95748e7
|
[
"MIT"
] | 8 |
2017-03-21T08:26:56.000Z
|
2020-06-27T01:55:09.000Z
| 26.121212 | 114 | 0.513921 | 3,061 |
package ua.com.fielden.platform.entity.query.metadata;
public class PropertyColumn {
private final String name;
private final Integer length;
private final Integer precision;
private final Integer scale;
public PropertyColumn(final String name, final Integer length, final Integer precision, final Integer scale) {
super();
this.name = name.toUpperCase();
this.length = length;
this.precision = precision;
this.scale = scale;
}
public PropertyColumn(final String name) {
this(name, null, null, null);
}
public String ddl() {
return name.toUpperCase() + " INT";
}
public String getName() {
return name;
}
public Integer getLength() {
return length;
}
public Integer getPrecision() {
return precision;
}
public Integer getScale() {
return scale;
}
@Override
public String toString() {
return name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((length == null) ? 0 : length.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((precision == null) ? 0 : precision.hashCode());
result = prime * result + ((scale == null) ? 0 : scale.hashCode());
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof PropertyColumn)) {
return false;
}
final PropertyColumn other = (PropertyColumn) obj;
if (length == null) {
if (other.length != null) {
return false;
}
} else if (!length.equals(other.length)) {
return false;
}
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
if (precision == null) {
if (other.precision != null) {
return false;
}
} else if (!precision.equals(other.precision)) {
return false;
}
if (scale == null) {
if (other.scale != null) {
return false;
}
} else if (!scale.equals(other.scale)) {
return false;
}
return true;
}
}
|
3e073db464709bf6127bf78fc5273e9270aa11b0
| 3,796 |
java
|
Java
|
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/parsing/types/TypeArguments.java
|
protector1990/intellij-community
|
b30024b236e84c803ee0b2df7c39eb18dbcaf827
|
[
"Apache-2.0"
] | 2 |
2018-12-29T09:53:39.000Z
|
2018-12-29T09:53:42.000Z
|
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/parsing/types/TypeArguments.java
|
protector1990/intellij-community
|
b30024b236e84c803ee0b2df7c39eb18dbcaf827
|
[
"Apache-2.0"
] | 3 |
2016-07-30T16:59:09.000Z
|
2021-11-03T12:25:51.000Z
|
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/parser/parsing/types/TypeArguments.java
|
protector1990/intellij-community
|
b30024b236e84c803ee0b2df7c39eb18dbcaf827
|
[
"Apache-2.0"
] | 1 |
2019-07-18T16:50:52.000Z
|
2019-07-18T16:50:52.000Z
| 33.298246 | 127 | 0.713383 | 3,062 |
/*
* Copyright 2000-2014 JetBrains s.r.o.
*
* 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.jetbrains.plugins.groovy.lang.parser.parsing.types;
import com.intellij.lang.PsiBuilder;
import org.jetbrains.plugins.groovy.GroovyBundle;
import org.jetbrains.plugins.groovy.lang.lexer.GroovyTokenTypes;
import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes;
import org.jetbrains.plugins.groovy.lang.parser.parsing.statements.typeDefinitions.ReferenceElement;
import org.jetbrains.plugins.groovy.lang.parser.parsing.util.ParserUtils;
/**
* @author: Dmitry.Krasilschikov
* @date: 28.03.2007
*/
public class TypeArguments {
public static boolean parseTypeArguments(PsiBuilder builder, boolean expressionPossible) {
return parseTypeArguments(builder, expressionPossible, false);
}
public static boolean parseTypeArguments(PsiBuilder builder, boolean expressionPossible, boolean allowDiamond) {
PsiBuilder.Marker marker = builder.mark();
if (!ParserUtils.getToken(builder, GroovyTokenTypes.mLT)) {
marker.rollbackTo();
return false;
}
ParserUtils.getToken(builder, GroovyTokenTypes.mNLS);
if (allowDiamond && ParserUtils.getToken(builder, GroovyTokenTypes.mGT)) {
marker.done(GroovyElementTypes.TYPE_ARGUMENTS);
return true;
}
if (!parseArgument(builder)) {
builder.error(GroovyBundle.message("type.argument.expected"));
if (ParserUtils.getToken(builder, GroovyTokenTypes.mGT)) {
marker.done(GroovyElementTypes.TYPE_ARGUMENTS);
return true;
}
else {
marker.rollbackTo();
return false;
}
}
boolean hasComma = ParserUtils.lookAhead(builder, GroovyTokenTypes.mCOMMA);
while (ParserUtils.getToken(builder, GroovyTokenTypes.mCOMMA)) {
ParserUtils.getToken(builder, GroovyTokenTypes.mNLS);
if (!parseArgument(builder)) {
builder.error("type.argument.expected");
}
}
PsiBuilder.Marker rb = builder.mark();
ParserUtils.getToken(builder, GroovyTokenTypes.mNLS);
if (ParserUtils.getToken(builder, GroovyTokenTypes.mGT)) {
rb.drop();
}
else if (hasComma) {
rb.rollbackTo();
builder.error(GroovyBundle.message("gt.expected"));
}
else {
rb.drop();
if (expressionPossible) {
marker.rollbackTo();
return false;
}
else {
builder.error(GroovyBundle.message("gt.expected"));
}
}
marker.done(GroovyElementTypes.TYPE_ARGUMENTS);
return true;
}
private static boolean parseArgument(PsiBuilder builder) {
if (builder.getTokenType() == GroovyTokenTypes.mQUESTION) {
//wildcard
PsiBuilder.Marker taMarker = builder.mark();
ParserUtils.getToken(builder, GroovyTokenTypes.mQUESTION);
if (ParserUtils.getToken(builder, GroovyTokenTypes.kSUPER) || ParserUtils.getToken(builder, GroovyTokenTypes.kEXTENDS)) {
ParserUtils.getToken(builder, GroovyTokenTypes.mNLS);
TypeSpec.parse(builder, false, false);
ParserUtils.getToken(builder, GroovyTokenTypes.mNLS);
}
taMarker.done(GroovyElementTypes.TYPE_ARGUMENT);
return true;
}
return TypeSpec.parse(builder, false, false) != ReferenceElement.ReferenceElementResult.FAIL;
}
}
|
3e073e2ddcb0cfe241d9f9631a34f23c6def5799
| 3,429 |
java
|
Java
|
astromine-core/src/main/java/com/github/mixinors/astromine/client/rei/alloysmelting/AlloySmeltingDisplay.java
|
JemmaZZ/Astromine
|
671f93f60f56154b798ac98179afd239f35d3a77
|
[
"MIT"
] | 116 |
2020-09-06T13:35:17.000Z
|
2022-03-31T14:05:33.000Z
|
astromine-core/src/main/java/com/github/mixinors/astromine/client/rei/alloysmelting/AlloySmeltingDisplay.java
|
JemmaZZ/Astromine
|
671f93f60f56154b798ac98179afd239f35d3a77
|
[
"MIT"
] | 150 |
2020-09-05T23:23:02.000Z
|
2022-02-06T23:40:22.000Z
|
astromine-core/src/main/java/com/github/mixinors/astromine/client/rei/alloysmelting/AlloySmeltingDisplay.java
|
JemmaZZ/Astromine
|
671f93f60f56154b798ac98179afd239f35d3a77
|
[
"MIT"
] | 34 |
2020-09-06T12:54:08.000Z
|
2022-01-22T20:04:16.000Z
| 34.636364 | 273 | 0.784194 | 3,063 |
/*
* MIT License
*
* Copyright (c) 2020, 2021 Mixinors
*
* 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.
*/
package com.github.mixinors.astromine.client.rei.alloysmelting;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.util.Identifier;
import com.github.mixinors.astromine.client.rei.AMRoughlyEnoughItemsPlugin;
import com.github.mixinors.astromine.client.rei.SimpleTransferRecipeDisplay;
import com.github.mixinors.astromine.common.recipe.AlloySmeltingRecipe;
import me.shedaniel.rei.api.EntryStack;
import org.jetbrains.annotations.NotNull;
import com.google.common.collect.Lists;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@Environment(EnvType.CLIENT)
public class AlloySmeltingDisplay extends SimpleTransferRecipeDisplay {
private final List<List<EntryStack>> inputs;
private final List<EntryStack> outputs;
private final int timeRequired;
private final double energyRequired;
private final Identifier recipeId;
public AlloySmeltingDisplay(AlloySmeltingRecipe recipe) {
this(Lists.newArrayList(EntryStack.ofItemStacks(Arrays.asList(recipe.getFirstInput().getMatchingStacks())), EntryStack.ofItemStacks(Arrays.asList(recipe.getSecondInput().getMatchingStacks()))), Collections.singletonList(EntryStack.create(recipe.getFirstOutput())), recipe
.getTime(), recipe.getEnergyInput(), recipe.getId());
}
public AlloySmeltingDisplay(List<List<EntryStack>> inputs, List<EntryStack> outputs, int timeRequired, double energyRequired, Identifier recipeId) {
super(1, 2);
this.inputs = inputs;
this.outputs = outputs;
this.timeRequired = timeRequired;
this.energyRequired = energyRequired;
this.recipeId = recipeId;
}
@Override
public List<List<EntryStack>> getInputEntries() {
return inputs;
}
@Override
public List<List<EntryStack>> getRequiredEntries() {
return getInputEntries();
}
@Override
public @NotNull List<List<EntryStack>> getResultingEntries() {
return Collections.singletonList(outputs);
}
public int getTimeRequired() {
return timeRequired;
}
public double getEnergyRequired() {
return energyRequired;
}
@Override
public Identifier getRecipeCategory() {
return AMRoughlyEnoughItemsPlugin.ALLOY_SMELTING;
}
@Override
public Optional<Identifier> getRecipeLocation() {
return Optional.ofNullable(this.recipeId);
}
}
|
3e073f081c446c0b745771f414f6eb058e2d2512
| 29,637 |
java
|
Java
|
proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/SessionProto.java
|
martini9393/java-dialogflow
|
7fc6b0ea1f978c814d3b4015340936bd3ce0218e
|
[
"Apache-2.0"
] | null | null | null |
proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/SessionProto.java
|
martini9393/java-dialogflow
|
7fc6b0ea1f978c814d3b4015340936bd3ce0218e
|
[
"Apache-2.0"
] | null | null | null |
proto-google-cloud-dialogflow-v2beta1/src/main/java/com/google/cloud/dialogflow/v2beta1/SessionProto.java
|
martini9393/java-dialogflow
|
7fc6b0ea1f978c814d3b4015340936bd3ce0218e
|
[
"Apache-2.0"
] | null | null | null | 59.631791 | 109 | 0.716368 | 3,064 |
/*
* 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
*
* https://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.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/session.proto
package com.google.cloud.dialogflow.v2beta1;
public final class SessionProto {
private SessionProto() {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {}
public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_WebhookHeadersEntry_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_WebhookHeadersEntry_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_QueryInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_QueryInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_QueryResult_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_QueryResult_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_Answer_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_Answer_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentRequest_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentResponse_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentResponse_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_StreamingRecognitionResult_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_StreamingRecognitionResult_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_TextInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_TextInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_EventInput_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_EventInput_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisRequestConfig_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisRequestConfig_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisResult_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisResult_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_cloud_dialogflow_v2beta1_Sentiment_descriptor;
static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_cloud_dialogflow_v2beta1_Sentiment_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor descriptor;
static {
java.lang.String[] descriptorData = {
"\n-google/cloud/dialogflow/v2beta1/sessio"
+ "n.proto\022\037google.cloud.dialogflow.v2beta1"
+ "\032\034google/api/annotations.proto\032\027google/a"
+ "pi/client.proto\032\037google/api/field_behavi"
+ "or.proto\032\031google/api/resource.proto\032+goo"
+ "gle/cloud/dialogflow/v2beta1/agent.proto"
+ "\0322google/cloud/dialogflow/v2beta1/audio_"
+ "config.proto\032-google/cloud/dialogflow/v2"
+ "beta1/context.proto\032)google/cloud/dialog"
+ "flow/v2beta1/gcs.proto\032,google/cloud/dia"
+ "logflow/v2beta1/intent.proto\0329google/clo"
+ "ud/dialogflow/v2beta1/session_entity_typ"
+ "e.proto\032\036google/protobuf/duration.proto\032"
+ " google/protobuf/field_mask.proto\032\034googl"
+ "e/protobuf/struct.proto\032\027google/rpc/stat"
+ "us.proto\032\030google/type/latlng.proto\"\204\003\n\023D"
+ "etectIntentRequest\022:\n\007session\030\001 \001(\tB)\340A\002"
+ "\372A#\n!dialogflow.googleapis.com/Session\022F"
+ "\n\014query_params\030\002 \001(\01320.google.cloud.dial"
+ "ogflow.v2beta1.QueryParameters\022E\n\013query_"
+ "input\030\003 \001(\0132+.google.cloud.dialogflow.v2"
+ "beta1.QueryInputB\003\340A\002\022O\n\023output_audio_co"
+ "nfig\030\004 \001(\01322.google.cloud.dialogflow.v2b"
+ "eta1.OutputAudioConfig\022<\n\030output_audio_c"
+ "onfig_mask\030\007 \001(\0132\032.google.protobuf.Field"
+ "Mask\022\023\n\013input_audio\030\005 \001(\014\"\323\002\n\024DetectInte"
+ "ntResponse\022\023\n\013response_id\030\001 \001(\t\022B\n\014query"
+ "_result\030\002 \001(\0132,.google.cloud.dialogflow."
+ "v2beta1.QueryResult\022O\n\031alternative_query"
+ "_results\030\005 \003(\0132,.google.cloud.dialogflow"
+ ".v2beta1.QueryResult\022*\n\016webhook_status\030\003"
+ " \001(\0132\022.google.rpc.Status\022\024\n\014output_audio"
+ "\030\004 \001(\014\022O\n\023output_audio_config\030\006 \001(\01322.go"
+ "ogle.cloud.dialogflow.v2beta1.OutputAudi"
+ "oConfig\"\376\004\n\017QueryParameters\022\021\n\ttime_zone"
+ "\030\001 \001(\t\022)\n\014geo_location\030\002 \001(\0132\023.google.ty"
+ "pe.LatLng\022:\n\010contexts\030\003 \003(\0132(.google.clo"
+ "ud.dialogflow.v2beta1.Context\022\026\n\016reset_c"
+ "ontexts\030\004 \001(\010\022P\n\024session_entity_types\030\005 "
+ "\003(\01322.google.cloud.dialogflow.v2beta1.Se"
+ "ssionEntityType\022(\n\007payload\030\006 \001(\0132\027.googl"
+ "e.protobuf.Struct\022\034\n\024knowledge_base_name"
+ "s\030\014 \003(\t\022j\n!sentiment_analysis_request_co"
+ "nfig\030\n \001(\0132?.google.cloud.dialogflow.v2b"
+ "eta1.SentimentAnalysisRequestConfig\022=\n\ns"
+ "ub_agents\030\r \003(\0132).google.cloud.dialogflo"
+ "w.v2beta1.SubAgent\022]\n\017webhook_headers\030\016 "
+ "\003(\0132D.google.cloud.dialogflow.v2beta1.Qu"
+ "eryParameters.WebhookHeadersEntry\0325\n\023Web"
+ "hookHeadersEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002"
+ " \001(\t:\0028\001\"\332\001\n\nQueryInput\022I\n\014audio_config\030"
+ "\001 \001(\01321.google.cloud.dialogflow.v2beta1."
+ "InputAudioConfigH\000\022:\n\004text\030\002 \001(\0132*.googl"
+ "e.cloud.dialogflow.v2beta1.TextInputH\000\022<"
+ "\n\005event\030\003 \001(\0132+.google.cloud.dialogflow."
+ "v2beta1.EventInputH\000B\007\n\005input\"\362\005\n\013QueryR"
+ "esult\022\022\n\nquery_text\030\001 \001(\t\022\025\n\rlanguage_co"
+ "de\030\017 \001(\t\022%\n\035speech_recognition_confidenc"
+ "e\030\002 \001(\002\022\016\n\006action\030\003 \001(\t\022+\n\nparameters\030\004 "
+ "\001(\0132\027.google.protobuf.Struct\022#\n\033all_requ"
+ "ired_params_present\030\005 \001(\010\022\030\n\020fulfillment"
+ "_text\030\006 \001(\t\022M\n\024fulfillment_messages\030\007 \003("
+ "\0132/.google.cloud.dialogflow.v2beta1.Inte"
+ "nt.Message\022\026\n\016webhook_source\030\010 \001(\t\0220\n\017we"
+ "bhook_payload\030\t \001(\0132\027.google.protobuf.St"
+ "ruct\022A\n\017output_contexts\030\n \003(\0132(.google.c"
+ "loud.dialogflow.v2beta1.Context\0227\n\006inten"
+ "t\030\013 \001(\0132\'.google.cloud.dialogflow.v2beta"
+ "1.Intent\022#\n\033intent_detection_confidence\030"
+ "\014 \001(\002\0220\n\017diagnostic_info\030\016 \001(\0132\027.google."
+ "protobuf.Struct\022[\n\031sentiment_analysis_re"
+ "sult\030\021 \001(\01328.google.cloud.dialogflow.v2b"
+ "eta1.SentimentAnalysisResult\022L\n\021knowledg"
+ "e_answers\030\022 \001(\01321.google.cloud.dialogflo"
+ "w.v2beta1.KnowledgeAnswers\"\257\003\n\020Knowledge"
+ "Answers\022I\n\007answers\030\001 \003(\01328.google.cloud."
+ "dialogflow.v2beta1.KnowledgeAnswers.Answ"
+ "er\032\317\002\n\006Answer\0227\n\006source\030\001 \001(\tB\'\372A$\n\"dial"
+ "ogflow.googleapis.com/Document\022\024\n\014faq_qu"
+ "estion\030\002 \001(\t\022\016\n\006answer\030\003 \001(\t\022m\n\026match_co"
+ "nfidence_level\030\004 \001(\0162M.google.cloud.dial"
+ "ogflow.v2beta1.KnowledgeAnswers.Answer.M"
+ "atchConfidenceLevel\022\030\n\020match_confidence\030"
+ "\005 \001(\002\"]\n\024MatchConfidenceLevel\022&\n\"MATCH_C"
+ "ONFIDENCE_LEVEL_UNSPECIFIED\020\000\022\007\n\003LOW\020\001\022\n"
+ "\n\006MEDIUM\020\002\022\010\n\004HIGH\020\003\"\201\003\n\034StreamingDetect"
+ "IntentRequest\022\024\n\007session\030\001 \001(\tB\003\340A\002\022F\n\014q"
+ "uery_params\030\002 \001(\01320.google.cloud.dialogf"
+ "low.v2beta1.QueryParameters\022E\n\013query_inp"
+ "ut\030\003 \001(\0132+.google.cloud.dialogflow.v2bet"
+ "a1.QueryInputB\003\340A\002\022\030\n\020single_utterance\030\004"
+ " \001(\010\022O\n\023output_audio_config\030\005 \001(\01322.goog"
+ "le.cloud.dialogflow.v2beta1.OutputAudioC"
+ "onfig\022<\n\030output_audio_config_mask\030\007 \001(\0132"
+ "\032.google.protobuf.FieldMask\022\023\n\013input_aud"
+ "io\030\006 \001(\014\"\265\003\n\035StreamingDetectIntentRespon"
+ "se\022\023\n\013response_id\030\001 \001(\t\022W\n\022recognition_r"
+ "esult\030\002 \001(\0132;.google.cloud.dialogflow.v2"
+ "beta1.StreamingRecognitionResult\022B\n\014quer"
+ "y_result\030\003 \001(\0132,.google.cloud.dialogflow"
+ ".v2beta1.QueryResult\022O\n\031alternative_quer"
+ "y_results\030\007 \003(\0132,.google.cloud.dialogflo"
+ "w.v2beta1.QueryResult\022*\n\016webhook_status\030"
+ "\004 \001(\0132\022.google.rpc.Status\022\024\n\014output_audi"
+ "o\030\005 \001(\014\022O\n\023output_audio_config\030\006 \001(\01322.g"
+ "oogle.cloud.dialogflow.v2beta1.OutputAud"
+ "ioConfig\"\356\003\n\032StreamingRecognitionResult\022"
+ "]\n\014message_type\030\001 \001(\0162G.google.cloud.dia"
+ "logflow.v2beta1.StreamingRecognitionResu"
+ "lt.MessageType\022\022\n\ntranscript\030\002 \001(\t\022\020\n\010is"
+ "_final\030\003 \001(\010\022\022\n\nconfidence\030\004 \001(\002\022\021\n\tstab"
+ "ility\030\006 \001(\002\022I\n\020speech_word_info\030\007 \003(\0132/."
+ "google.cloud.dialogflow.v2beta1.SpeechWo"
+ "rdInfo\0224\n\021speech_end_offset\030\010 \001(\0132\031.goog"
+ "le.protobuf.Duration\022I\n\013dtmf_digits\030\005 \001("
+ "\01324.google.cloud.dialogflow.v2beta1.Tele"
+ "phonyDtmfEvents\"X\n\013MessageType\022\034\n\030MESSAG"
+ "E_TYPE_UNSPECIFIED\020\000\022\016\n\nTRANSCRIPT\020\001\022\033\n\027"
+ "END_OF_SINGLE_UTTERANCE\020\002\"0\n\tTextInput\022\014"
+ "\n\004text\030\001 \001(\t\022\025\n\rlanguage_code\030\002 \001(\t\"^\n\nE"
+ "ventInput\022\014\n\004name\030\001 \001(\t\022+\n\nparameters\030\002 "
+ "\001(\0132\027.google.protobuf.Struct\022\025\n\rlanguage"
+ "_code\030\003 \001(\t\"F\n\036SentimentAnalysisRequestC"
+ "onfig\022$\n\034analyze_query_text_sentiment\030\001 "
+ "\001(\010\"c\n\027SentimentAnalysisResult\022H\n\024query_"
+ "text_sentiment\030\001 \001(\0132*.google.cloud.dial"
+ "ogflow.v2beta1.Sentiment\"-\n\tSentiment\022\r\n"
+ "\005score\030\001 \001(\002\022\021\n\tmagnitude\030\002 \001(\0022\215\006\n\010Sess"
+ "ions\022\347\003\n\014DetectIntent\0224.google.cloud.dia"
+ "logflow.v2beta1.DetectIntentRequest\0325.go"
+ "ogle.cloud.dialogflow.v2beta1.DetectInte"
+ "ntResponse\"\351\002\202\323\344\223\002\314\002\";/v2beta1/{session="
+ "projects/*/agent/sessions/*}:detectInten"
+ "t:\001*ZW\"R/v2beta1/{session=projects/*/age"
+ "nt/environments/*/users/*/sessions/*}:de"
+ "tectIntent:\001*ZL\"G/v2beta1/{session=proje"
+ "cts/*/locations/*/agent/sessions/*}:dete"
+ "ctIntent:\001*Zc\"^/v2beta1/{session=project"
+ "s/*/locations/*/agent/environments/*/use"
+ "rs/*/sessions/*}:detectIntent:\001*\332A\023sessi"
+ "on,query_input\022\234\001\n\025StreamingDetectIntent"
+ "\022=.google.cloud.dialogflow.v2beta1.Strea"
+ "mingDetectIntentRequest\032>.google.cloud.d"
+ "ialogflow.v2beta1.StreamingDetectIntentR"
+ "esponse\"\000(\0010\001\032x\312A\031dialogflow.googleapis."
+ "com\322AYhttps://www.googleapis.com/auth/cl"
+ "oud-platform,https://www.googleapis.com/"
+ "auth/dialogflowB\225\003\n#com.google.cloud.dia"
+ "logflow.v2beta1B\014SessionProtoP\001ZIgoogle."
+ "golang.org/genproto/googleapis/cloud/dia"
+ "logflow/v2beta1;dialogflow\370\001\001\242\002\002DF\252\002\037Goo"
+ "gle.Cloud.Dialogflow.V2beta1\352A\347\001\n!dialog"
+ "flow.googleapis.com/Session\022+projects/{p"
+ "roject}/agent/sessions/{session}\022Sprojec"
+ "ts/{project}/agent/environments/{environ"
+ "ment}/users/{user}/sessions/{session}\022@p"
+ "rojects/{project}/locations/{location}/a"
+ "gent/sessions/{session}b\006proto3"
};
descriptor =
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.api.AnnotationsProto.getDescriptor(),
com.google.api.ClientProto.getDescriptor(),
com.google.api.FieldBehaviorProto.getDescriptor(),
com.google.api.ResourceProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.AgentProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.AudioConfigProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.ContextProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.GcsProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.IntentProto.getDescriptor(),
com.google.cloud.dialogflow.v2beta1.SessionEntityTypeProto.getDescriptor(),
com.google.protobuf.DurationProto.getDescriptor(),
com.google.protobuf.FieldMaskProto.getDescriptor(),
com.google.protobuf.StructProto.getDescriptor(),
com.google.rpc.StatusProto.getDescriptor(),
com.google.type.LatLngProto.getDescriptor(),
});
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentRequest_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentRequest_descriptor,
new java.lang.String[] {
"Session",
"QueryParams",
"QueryInput",
"OutputAudioConfig",
"OutputAudioConfigMask",
"InputAudio",
});
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentResponse_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_DetectIntentResponse_descriptor,
new java.lang.String[] {
"ResponseId",
"QueryResult",
"AlternativeQueryResults",
"WebhookStatus",
"OutputAudio",
"OutputAudioConfig",
});
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_descriptor,
new java.lang.String[] {
"TimeZone",
"GeoLocation",
"Contexts",
"ResetContexts",
"SessionEntityTypes",
"Payload",
"KnowledgeBaseNames",
"SentimentAnalysisRequestConfig",
"SubAgents",
"WebhookHeaders",
});
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_WebhookHeadersEntry_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_WebhookHeadersEntry_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_QueryParameters_WebhookHeadersEntry_descriptor,
new java.lang.String[] {
"Key", "Value",
});
internal_static_google_cloud_dialogflow_v2beta1_QueryInput_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_google_cloud_dialogflow_v2beta1_QueryInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_QueryInput_descriptor,
new java.lang.String[] {
"AudioConfig", "Text", "Event", "Input",
});
internal_static_google_cloud_dialogflow_v2beta1_QueryResult_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_google_cloud_dialogflow_v2beta1_QueryResult_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_QueryResult_descriptor,
new java.lang.String[] {
"QueryText",
"LanguageCode",
"SpeechRecognitionConfidence",
"Action",
"Parameters",
"AllRequiredParamsPresent",
"FulfillmentText",
"FulfillmentMessages",
"WebhookSource",
"WebhookPayload",
"OutputContexts",
"Intent",
"IntentDetectionConfidence",
"DiagnosticInfo",
"SentimentAnalysisResult",
"KnowledgeAnswers",
});
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_descriptor,
new java.lang.String[] {
"Answers",
});
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_Answer_descriptor =
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_descriptor
.getNestedTypes()
.get(0);
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_Answer_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_KnowledgeAnswers_Answer_descriptor,
new java.lang.String[] {
"Source", "FaqQuestion", "Answer", "MatchConfidenceLevel", "MatchConfidence",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentRequest_descriptor =
getDescriptor().getMessageTypes().get(6);
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentRequest_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentRequest_descriptor,
new java.lang.String[] {
"Session",
"QueryParams",
"QueryInput",
"SingleUtterance",
"OutputAudioConfig",
"OutputAudioConfigMask",
"InputAudio",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentResponse_descriptor =
getDescriptor().getMessageTypes().get(7);
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentResponse_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingDetectIntentResponse_descriptor,
new java.lang.String[] {
"ResponseId",
"RecognitionResult",
"QueryResult",
"AlternativeQueryResults",
"WebhookStatus",
"OutputAudio",
"OutputAudioConfig",
});
internal_static_google_cloud_dialogflow_v2beta1_StreamingRecognitionResult_descriptor =
getDescriptor().getMessageTypes().get(8);
internal_static_google_cloud_dialogflow_v2beta1_StreamingRecognitionResult_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_StreamingRecognitionResult_descriptor,
new java.lang.String[] {
"MessageType",
"Transcript",
"IsFinal",
"Confidence",
"Stability",
"SpeechWordInfo",
"SpeechEndOffset",
"DtmfDigits",
});
internal_static_google_cloud_dialogflow_v2beta1_TextInput_descriptor =
getDescriptor().getMessageTypes().get(9);
internal_static_google_cloud_dialogflow_v2beta1_TextInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_TextInput_descriptor,
new java.lang.String[] {
"Text", "LanguageCode",
});
internal_static_google_cloud_dialogflow_v2beta1_EventInput_descriptor =
getDescriptor().getMessageTypes().get(10);
internal_static_google_cloud_dialogflow_v2beta1_EventInput_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_EventInput_descriptor,
new java.lang.String[] {
"Name", "Parameters", "LanguageCode",
});
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisRequestConfig_descriptor =
getDescriptor().getMessageTypes().get(11);
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisRequestConfig_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisRequestConfig_descriptor,
new java.lang.String[] {
"AnalyzeQueryTextSentiment",
});
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisResult_descriptor =
getDescriptor().getMessageTypes().get(12);
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisResult_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_SentimentAnalysisResult_descriptor,
new java.lang.String[] {
"QueryTextSentiment",
});
internal_static_google_cloud_dialogflow_v2beta1_Sentiment_descriptor =
getDescriptor().getMessageTypes().get(13);
internal_static_google_cloud_dialogflow_v2beta1_Sentiment_fieldAccessorTable =
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_cloud_dialogflow_v2beta1_Sentiment_descriptor,
new java.lang.String[] {
"Score", "Magnitude",
});
com.google.protobuf.ExtensionRegistry registry =
com.google.protobuf.ExtensionRegistry.newInstance();
registry.add(com.google.api.ClientProto.defaultHost);
registry.add(com.google.api.FieldBehaviorProto.fieldBehavior);
registry.add(com.google.api.AnnotationsProto.http);
registry.add(com.google.api.ClientProto.methodSignature);
registry.add(com.google.api.ClientProto.oauthScopes);
registry.add(com.google.api.ResourceProto.resourceDefinition);
registry.add(com.google.api.ResourceProto.resourceReference);
com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor(
descriptor, registry);
com.google.api.AnnotationsProto.getDescriptor();
com.google.api.ClientProto.getDescriptor();
com.google.api.FieldBehaviorProto.getDescriptor();
com.google.api.ResourceProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.AgentProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.AudioConfigProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.ContextProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.GcsProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.IntentProto.getDescriptor();
com.google.cloud.dialogflow.v2beta1.SessionEntityTypeProto.getDescriptor();
com.google.protobuf.DurationProto.getDescriptor();
com.google.protobuf.FieldMaskProto.getDescriptor();
com.google.protobuf.StructProto.getDescriptor();
com.google.rpc.StatusProto.getDescriptor();
com.google.type.LatLngProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
|
3e073f1d584829ff35d84009e926a16587f824b1
| 709 |
java
|
Java
|
src/com/cladonia/xslt/debugger/ui/TraceNode.java
|
HiltonRoscoe/exchangerxml
|
6da3871f1094633bd98c95fd3f404cfbf805fe43
|
[
"ClArtistic"
] | 6 |
2021-01-31T21:22:32.000Z
|
2021-07-13T04:52:24.000Z
|
src/com/cladonia/xslt/debugger/ui/TraceNode.java
|
HiltonRoscoe/exchangerxml
|
6da3871f1094633bd98c95fd3f404cfbf805fe43
|
[
"ClArtistic"
] | 8 |
2021-01-08T20:49:50.000Z
|
2021-06-27T23:14:03.000Z
|
src/com/cladonia/xslt/debugger/ui/TraceNode.java
|
HiltonRoscoe/exchangerxml
|
6da3871f1094633bd98c95fd3f404cfbf805fe43
|
[
"ClArtistic"
] | null | null | null | 23.633333 | 67 | 0.675599 | 3,065 |
/*
* $Id: TraceNode.java,v 1.1 2004/05/11 13:19:06 edankert Exp $
*
* Copyright (C) 2002, Cladonia Ltd. All rights reserved.
*
* This software is the proprietary information of Cladonia Ltd.
* Use is subject to license terms.
*/
package com.cladonia.xslt.debugger.ui;
import javax.swing.tree.DefaultMutableTreeNode;
/**
* The base node class for the DOM Editor tree.
*
* @version $Revision: 1.1 $, $Date: 2004/05/11 13:19:06 $
* @author Dogsbay
*/
public class TraceNode extends DefaultMutableTreeNode {
Object stackItem = null;
public TraceNode( Object stackItem) {
this.stackItem = stackItem;
}
public Object getStackItem() {
return stackItem;
}
}
|
3e073fa73848a6f19fc763f212405c39b75adea3
| 4,949 |
java
|
Java
|
cuebot/src/main/java/com/imageworks/spcue/LocalHostAssignment.java
|
jkellefiel4/OpenCue
|
b0faee1d49f52dda076fe03467446f0a0c6ef327
|
[
"Apache-2.0"
] | 334 |
2019-01-23T13:48:08.000Z
|
2019-06-10T06:58:49.000Z
|
cuebot/src/main/java/com/imageworks/spcue/LocalHostAssignment.java
|
jkellefiel4/OpenCue
|
b0faee1d49f52dda076fe03467446f0a0c6ef327
|
[
"Apache-2.0"
] | 564 |
2019-06-11T15:31:48.000Z
|
2022-03-31T19:53:03.000Z
|
cuebot/src/main/java/com/imageworks/spcue/LocalHostAssignment.java
|
jkellefiel4/OpenCue
|
b0faee1d49f52dda076fe03467446f0a0c6ef327
|
[
"Apache-2.0"
] | 155 |
2019-06-13T11:42:00.000Z
|
2022-03-16T18:31:24.000Z
| 24.141463 | 107 | 0.65488 | 3,066 |
/*
* Copyright Contributors to the OpenCue Project
*
* 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 com.imageworks.spcue;
import com.imageworks.spcue.dispatcher.ResourceContainer;
import com.imageworks.spcue.grpc.renderpartition.RenderPartitionType;
/**
* Contains information about local desktop cores a user has
* assigned to the given job.
*
* The local-only option, if true, means the job will only dispatch
* a user's local cores. If false, the job will dispatch cores from
* both the user's machine and the render farm.
*/
public class LocalHostAssignment extends Entity
implements ResourceContainer {
private int idleCoreUnits;
private long idleMemory;
private int idleGpuUnits;
private long idleGpuMemory;
private long maxMemory;
private long maxGpuMemory;
private int maxCoreUnits;
private int maxGpuUnits;
private int threads;
private String hostId;
private String jobId = null;
private String layerId = null;
private String frameId = null;
private RenderPartitionType type;
public LocalHostAssignment() { }
public LocalHostAssignment(int maxCores, int threads, long maxMemory, int maxGpus, long maxGpuMemory) {
this.maxCoreUnits = maxCores;
this.threads = threads;
this.maxMemory = maxMemory;
this.maxGpuUnits = maxGpus;
this.maxGpuMemory = maxGpuMemory;
}
@Override
public boolean hasAdditionalResources(int minCores, long minMemory, int minGpus, long minGpuMemory) {
if (idleCoreUnits < minCores) {
return false;
}
else if (idleMemory < minMemory) {
return false;
}
else if (idleGpuUnits < minGpus) {
return false;
}
else if (idleGpuMemory < minGpuMemory) {
return false;
}
return true;
}
@Override
public void useResources(int coreUnits, long memory, int gpuUnits, long gpuMemory) {
idleCoreUnits = idleCoreUnits - coreUnits;
idleMemory = idleMemory - memory;
idleGpuUnits = idleGpuUnits - gpuUnits;
idleGpuMemory = idleGpuMemory - gpuMemory;
}
public int getThreads() {
return threads;
}
public void setThreads(int threads) {
this.threads = threads;
}
public long getMaxMemory() {
return maxMemory;
}
public void setMaxMemory(long maxMemory) {
this.maxMemory = maxMemory;
}
public int getMaxCoreUnits() {
return maxCoreUnits;
}
public void setMaxCoreUnits(int maxCoreUnits) {
this.maxCoreUnits = maxCoreUnits;
}
public long getIdleMemory() {
return this.idleMemory;
}
public int getMaxGpuUnits() {
return maxGpuUnits;
}
public void setMaxGpuUnits(int maxGpuUnits) {
this.maxGpuUnits = maxGpuUnits;
}
public long getMaxGpuMemory() {
return maxGpuMemory;
}
public void setMaxGpuMemory(long maxGpuMemory) {
this.maxGpuMemory = maxGpuMemory;
}
public long getIdleGpuMemory() {
return this.idleGpuMemory;
}
public int getIdleCoreUnits() {
return this.idleCoreUnits;
}
public void setIdleCoreUnits(int idleCoreUnits) {
this.idleCoreUnits = idleCoreUnits;
}
public void setIdleMemory(long idleMemory) {
this.idleMemory = idleMemory;
}
public int getIdleGpuUnits() {
return this.idleGpuUnits;
}
public void setIdleGpuUnits(int idleGpuUnits) {
this.idleGpuUnits = idleGpuUnits;
}
public void setIdleGpuMemory(long idleGpuMemory) {
this.idleGpuMemory = idleGpuMemory;
}
public String getHostId() {
return hostId;
}
public void setHostId(String hostId) {
this.hostId = hostId;
}
public String getJobId() {
return jobId;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
public String getLayerId() {
return layerId;
}
public void setLayerId(String layerId) {
this.layerId = layerId;
}
public String getFrameId() {
return frameId;
}
public void setFrameId(String frameId) {
this.frameId = frameId;
}
public RenderPartitionType getType() {
return type;
}
public void setType(RenderPartitionType type) {
this.type = type;
}
}
|
3e073ffdff34cc822706924a646fa2e8c830b3f1
| 11,123 |
java
|
Java
|
app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/transition/R.java
|
avshapovalov/NotesDiplom
|
3729ab689c6880b63c092d723419d75d05d8ec4d
|
[
"Apache-2.0"
] | null | null | null |
app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/transition/R.java
|
avshapovalov/NotesDiplom
|
3729ab689c6880b63c092d723419d75d05d8ec4d
|
[
"Apache-2.0"
] | null | null | null |
app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/android/support/transition/R.java
|
avshapovalov/NotesDiplom
|
3729ab689c6880b63c092d723419d75d05d8ec4d
|
[
"Apache-2.0"
] | null | null | null | 57.335052 | 185 | 0.740088 | 3,067 |
/* 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.transition;
public final class R {
private R() {}
public static final class attr {
private attr() {}
public static final int alpha = 0x7f030027;
public static final int font = 0x7f0300db;
public static final int fontProviderAuthority = 0x7f0300dd;
public static final int fontProviderCerts = 0x7f0300de;
public static final int fontProviderFetchStrategy = 0x7f0300df;
public static final int fontProviderFetchTimeout = 0x7f0300e0;
public static final int fontProviderPackage = 0x7f0300e1;
public static final int fontProviderQuery = 0x7f0300e2;
public static final int fontStyle = 0x7f0300e3;
public static final int fontVariationSettings = 0x7f0300e4;
public static final int fontWeight = 0x7f0300e5;
public static final int ttcIndex = 0x7f030218;
}
public static final class color {
private color() {}
public static final int notification_action_color_filter = 0x7f05006f;
public static final int notification_icon_bg_color = 0x7f050070;
public static final int ripple_material_light = 0x7f05007a;
public static final int secondary_text_default_material_light = 0x7f05007c;
}
public static final class dimen {
private dimen() {}
public static final int compat_button_inset_horizontal_material = 0x7f060050;
public static final int compat_button_inset_vertical_material = 0x7f060051;
public static final int compat_button_padding_horizontal_material = 0x7f060052;
public static final int compat_button_padding_vertical_material = 0x7f060053;
public static final int compat_control_corner_material = 0x7f060054;
public static final int compat_notification_large_icon_max_height = 0x7f060055;
public static final int compat_notification_large_icon_max_width = 0x7f060056;
public static final int notification_action_icon_size = 0x7f0600c9;
public static final int notification_action_text_size = 0x7f0600ca;
public static final int notification_big_circle_margin = 0x7f0600cb;
public static final int notification_content_margin_start = 0x7f0600cc;
public static final int notification_large_icon_height = 0x7f0600cd;
public static final int notification_large_icon_width = 0x7f0600ce;
public static final int notification_main_column_padding_top = 0x7f0600cf;
public static final int notification_media_narrow_margin = 0x7f0600d0;
public static final int notification_right_icon_size = 0x7f0600d1;
public static final int notification_right_side_padding_top = 0x7f0600d2;
public static final int notification_small_icon_background_padding = 0x7f0600d3;
public static final int notification_small_icon_size_as_large = 0x7f0600d4;
public static final int notification_subtext_size = 0x7f0600d5;
public static final int notification_top_pad = 0x7f0600d6;
public static final int notification_top_pad_large_text = 0x7f0600d7;
}
public static final class drawable {
private drawable() {}
public static final int notification_action_background = 0x7f070078;
public static final int notification_bg = 0x7f070079;
public static final int notification_bg_low = 0x7f07007a;
public static final int notification_bg_low_normal = 0x7f07007b;
public static final int notification_bg_low_pressed = 0x7f07007c;
public static final int notification_bg_normal = 0x7f07007d;
public static final int notification_bg_normal_pressed = 0x7f07007e;
public static final int notification_icon_background = 0x7f07007f;
public static final int notification_template_icon_bg = 0x7f070080;
public static final int notification_template_icon_low_bg = 0x7f070081;
public static final int notification_tile_bg = 0x7f070082;
public static final int notify_panel_notification_icon_bg = 0x7f070083;
}
public static final class id {
private id() {}
public static final int action_container = 0x7f09000d;
public static final int action_divider = 0x7f09000f;
public static final int action_image = 0x7f090010;
public static final int action_text = 0x7f090018;
public static final int actions = 0x7f090019;
public static final int async = 0x7f090020;
public static final int blocking = 0x7f090024;
public static final int chronometer = 0x7f090030;
public static final int forever = 0x7f09005a;
public static final int ghost_view = 0x7f09005b;
public static final int icon = 0x7f090061;
public static final int icon_group = 0x7f090062;
public static final int info = 0x7f090066;
public static final int italic = 0x7f090068;
public static final int line1 = 0x7f09006d;
public static final int line3 = 0x7f09006e;
public static final int normal = 0x7f09007b;
public static final int notification_background = 0x7f090081;
public static final int notification_main_column = 0x7f090082;
public static final int notification_main_column_container = 0x7f090083;
public static final int parent_matrix = 0x7f090089;
public static final int right_icon = 0x7f090095;
public static final int right_side = 0x7f090096;
public static final int save_image_matrix = 0x7f090097;
public static final int save_non_transition_alpha = 0x7f090098;
public static final int save_scale_type = 0x7f09009a;
public static final int tag_transition_group = 0x7f0900c5;
public static final int tag_unhandled_key_event_manager = 0x7f0900c6;
public static final int tag_unhandled_key_listeners = 0x7f0900c7;
public static final int text = 0x7f0900c8;
public static final int text2 = 0x7f0900c9;
public static final int time = 0x7f0900d1;
public static final int title = 0x7f0900d2;
public static final int transition_current_scene = 0x7f0900d8;
public static final int transition_layout_save = 0x7f0900d9;
public static final int transition_position = 0x7f0900da;
public static final int transition_scene_layoutid_cache = 0x7f0900db;
public static final int transition_transform = 0x7f0900dc;
}
public static final class integer {
private integer() {}
public static final int status_bar_notification_info_maxnum = 0x7f0a000e;
}
public static final class layout {
private layout() {}
public static final int notification_action = 0x7f0c0033;
public static final int notification_action_tombstone = 0x7f0c0034;
public static final int notification_template_custom_big = 0x7f0c0035;
public static final int notification_template_icon_group = 0x7f0c0036;
public static final int notification_template_part_chronometer = 0x7f0c0037;
public static final int notification_template_part_time = 0x7f0c0038;
}
public static final class string {
private string() {}
public static final int status_bar_notification_info_overflow = 0x7f0f0058;
}
public static final class style {
private style() {}
public static final int TextAppearance_Compat_Notification = 0x7f100115;
public static final int TextAppearance_Compat_Notification_Info = 0x7f100116;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f100117;
public static final int TextAppearance_Compat_Notification_Time = 0x7f100118;
public static final int TextAppearance_Compat_Notification_Title = 0x7f100119;
public static final int Widget_Compat_NotificationActionContainer = 0x7f1001bf;
public static final int Widget_Compat_NotificationActionText = 0x7f1001c0;
}
public static final class styleable {
private styleable() {}
public static final int[] ColorStateListItem = { 0x10101a5, 0x101031f, 0x7f030027 };
public static final int ColorStateListItem_android_color = 0;
public static final int ColorStateListItem_android_alpha = 1;
public static final int ColorStateListItem_alpha = 2;
public static final int[] FontFamily = { 0x7f0300dd, 0x7f0300de, 0x7f0300df, 0x7f0300e0, 0x7f0300e1, 0x7f0300e2 };
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 = { 0x1010532, 0x1010533, 0x101053f, 0x101056f, 0x1010570, 0x7f0300db, 0x7f0300e3, 0x7f0300e4, 0x7f0300e5, 0x7f030218 };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_android_ttcIndex = 3;
public static final int FontFamilyFont_android_fontVariationSettings = 4;
public static final int FontFamilyFont_font = 5;
public static final int FontFamilyFont_fontStyle = 6;
public static final int FontFamilyFont_fontVariationSettings = 7;
public static final int FontFamilyFont_fontWeight = 8;
public static final int FontFamilyFont_ttcIndex = 9;
public static final int[] GradientColor = { 0x101019d, 0x101019e, 0x10101a1, 0x10101a2, 0x10101a3, 0x10101a4, 0x1010201, 0x101020b, 0x1010510, 0x1010511, 0x1010512, 0x1010513 };
public static final int GradientColor_android_startColor = 0;
public static final int GradientColor_android_endColor = 1;
public static final int GradientColor_android_type = 2;
public static final int GradientColor_android_centerX = 3;
public static final int GradientColor_android_centerY = 4;
public static final int GradientColor_android_gradientRadius = 5;
public static final int GradientColor_android_tileMode = 6;
public static final int GradientColor_android_centerColor = 7;
public static final int GradientColor_android_startX = 8;
public static final int GradientColor_android_startY = 9;
public static final int GradientColor_android_endX = 10;
public static final int GradientColor_android_endY = 11;
public static final int[] GradientColorItem = { 0x10101a5, 0x1010514 };
public static final int GradientColorItem_android_color = 0;
public static final int GradientColorItem_android_offset = 1;
}
}
|
3e0740b2aec8ef7cc7799b22938dbd30ea1c2614
| 2,376 |
java
|
Java
|
tool/src/org/antlr/v4/tool/LeftRecursionCyclesMessage.java
|
michaelpj/antlr4
|
68bf457b874256683cfb5e3733f78c29ee41a4bc
|
[
"BSD-3-Clause"
] | 408 |
2016-04-21T09:40:08.000Z
|
2022-03-22T02:05:29.000Z
|
tool/src/org/antlr/v4/tool/LeftRecursionCyclesMessage.java
|
michaelpj/antlr4
|
68bf457b874256683cfb5e3733f78c29ee41a4bc
|
[
"BSD-3-Clause"
] | 25 |
2016-01-24T17:28:49.000Z
|
2021-05-05T19:17:55.000Z
|
tool/src/org/antlr/v4/tool/LeftRecursionCyclesMessage.java
|
michaelpj/antlr4
|
68bf457b874256683cfb5e3733f78c29ee41a4bc
|
[
"BSD-3-Clause"
] | 78 |
2016-02-14T07:22:21.000Z
|
2022-02-10T08:23:12.000Z
| 38.322581 | 100 | 0.710438 | 3,068 |
/*
* [The "BSD license"]
* Copyright (c) 2012 Terence Parr
* Copyright (c) 2012 Sam Harwell
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 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 of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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 org.antlr.v4.tool;
import org.antlr.runtime.Token;
import java.util.Collection;
public class LeftRecursionCyclesMessage extends ANTLRMessage {
public LeftRecursionCyclesMessage(String fileName, Collection<? extends Collection<Rule>> cycles) {
super(ErrorType.LEFT_RECURSION_CYCLES, getStartTokenOfFirstRule(cycles), cycles);
this.fileName = fileName;
}
protected static Token getStartTokenOfFirstRule(Collection<? extends Collection<Rule>> cycles) {
if (cycles == null) {
return null;
}
for (Collection<Rule> collection : cycles) {
if (collection == null) {
return null;
}
for (Rule rule : collection) {
if (rule.ast != null) {
return rule.ast.getToken();
}
}
}
return null;
}
}
|
3e0740fa42ccbe1d9446e08295f8d39fe687c783
| 1,462 |
java
|
Java
|
src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IFormat.java
|
Kpunto/scelight
|
99672f74ac55b96dc7875bbe39bafba38f1bb099
|
[
"Apache-2.0"
] | 114 |
2016-02-04T13:47:21.000Z
|
2021-12-17T19:39:16.000Z
|
src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IFormat.java
|
Kpunto/scelight
|
99672f74ac55b96dc7875bbe39bafba38f1bb099
|
[
"Apache-2.0"
] | 25 |
2016-02-04T22:19:57.000Z
|
2022-02-25T09:54:46.000Z
|
src-ext-mod-api/hu/scelightapi/sc2/rep/repproc/IFormat.java
|
Kpunto/scelight
|
99672f74ac55b96dc7875bbe39bafba38f1bb099
|
[
"Apache-2.0"
] | 20 |
2016-02-04T18:11:54.000Z
|
2022-02-23T21:56:24.000Z
| 24.35 | 109 | 0.584531 | 3,069 |
/*
* Project Scelight
*
* Copyright (c) 2013 Andras Belicza <[email protected]>
*
* This software is the property of Andras Belicza.
* Copying, modifying, distributing, refactoring without the author's permission
* is prohibited and protected by Law.
*/
package hu.scelightapi.sc2.rep.repproc;
import hu.scelight.sc2.rep.repproc.Format;
import hu.scelightapibase.util.IEnum;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* Format.
*
* @author Andras Belicza
*
* @see IEnum
*/
public interface IFormat extends IEnum {
/** 1v1. */
IFormat ONE_VS_ONE = Format.ONE_VS_ONE;
/** 2v2. */
IFormat TWO_VS_TWO = Format.TWO_VS_TWO;
/** 3v3. */
IFormat THREE_VS_THREE = Format.THREE_VS_THREE;
/** 4v4. */
IFormat FOUR_VS_FOUR = Format.FOUR_VS_FOUR;
/** Archon. */
IFormat ARCHON = Format.ARCHON;
/** 5v5. */
IFormat FIVE_VS_FIVE = Format.FIVE_VS_FIVE;
/** 6v6. */
IFormat SIX_VS_SIX = Format.SIX_VS_SIX;
/** FFA. */
IFormat FFA = Format.FFA;
/** Custom (e.g. 2v3). */
IFormat CUSTOM = Format.CUSTOM;
/** An unmodifiable list of all the formats. */
List< IFormat > VALUE_LIST = Collections.unmodifiableList( Arrays.< IFormat > asList( Format.VALUES ) );
}
|
3e074118202eeac12bac978d146e2c7cb5306e50
| 257 |
java
|
Java
|
src/main/java/com/wyy/security/SystemConstants.java
|
zzl113/Springboot
|
c4be33c0d10faed99f58cd39b4f03067c29d5d5c
|
[
"Apache-2.0"
] | 1 |
2019-01-25T13:12:42.000Z
|
2019-01-25T13:12:42.000Z
|
src/main/java/com/wyy/security/SystemConstants.java
|
zzl113/Springboot
|
c4be33c0d10faed99f58cd39b4f03067c29d5d5c
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/wyy/security/SystemConstants.java
|
zzl113/Springboot
|
c4be33c0d10faed99f58cd39b4f03067c29d5d5c
|
[
"Apache-2.0"
] | null | null | null | 16.0625 | 49 | 0.677043 | 3,070 |
package com.wyy.security;
/**
* Created by Administrator on 2017/1/5.
*/
public final class SystemConstants {
public static final String SYSTEM = "system";
public static final String TENANT = "tenant";
private SystemConstants() {
}
}
|
3e07415a1198ac5e33f285f9732ad3d06881e282
| 10,597 |
java
|
Java
|
Corpus/birt/2532.java
|
JamesCao2048/BlizzardData
|
a524bec4f0d297bb748234eeb1c2fcdee3dce7d7
|
[
"MIT"
] | 1 |
2022-01-15T02:47:45.000Z
|
2022-01-15T02:47:45.000Z
|
Corpus/birt/2532.java
|
JamesCao2048/BlizzardData
|
a524bec4f0d297bb748234eeb1c2fcdee3dce7d7
|
[
"MIT"
] | null | null | null |
Corpus/birt/2532.java
|
JamesCao2048/BlizzardData
|
a524bec4f0d297bb748234eeb1c2fcdee3dce7d7
|
[
"MIT"
] | null | null | null | 36.167235 | 91 | 0.707842 | 3,071 |
/***********************************************************************
* Copyright (c) 2004, 2005 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
***********************************************************************/
package org.eclipse.birt.chart.examples.view.models;
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.DialChart;
import org.eclipse.birt.chart.model.attribute.Fill;
import org.eclipse.birt.chart.model.attribute.LineDecorator;
import org.eclipse.birt.chart.model.attribute.LineStyle;
import org.eclipse.birt.chart.model.attribute.TickStyle;
import org.eclipse.birt.chart.model.attribute.impl.ColorDefinitionImpl;
import org.eclipse.birt.chart.model.attribute.impl.GradientImpl;
import org.eclipse.birt.chart.model.attribute.impl.LineAttributesImpl;
import org.eclipse.birt.chart.model.component.DialRegion;
import org.eclipse.birt.chart.model.component.Series;
import org.eclipse.birt.chart.model.component.impl.DialRegionImpl;
import org.eclipse.birt.chart.model.component.impl.SeriesImpl;
import org.eclipse.birt.chart.model.data.BaseSampleData;
import org.eclipse.birt.chart.model.data.DataFactory;
import org.eclipse.birt.chart.model.data.OrthogonalSampleData;
import org.eclipse.birt.chart.model.data.SampleData;
import org.eclipse.birt.chart.model.data.SeriesDefinition;
import org.eclipse.birt.chart.model.data.TextDataSet;
import org.eclipse.birt.chart.model.data.impl.NumberDataElementImpl;
import org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl;
import org.eclipse.birt.chart.model.data.impl.SeriesDefinitionImpl;
import org.eclipse.birt.chart.model.data.impl.TextDataSetImpl;
import org.eclipse.birt.chart.model.impl.DialChartImpl;
import org.eclipse.birt.chart.model.type.DialSeries;
import org.eclipse.birt.chart.model.type.impl.DialSeriesImpl;
public class SuperImposedMeter
{
public static final Chart createSuperImposedMeter( )
{
DialChart dChart = (DialChart) DialChartImpl.create( );
dChart.setType( "Meter Chart" ); //$NON-NLS-1$
dChart.setSubType( "Superimposed Meter Chart" ); //$NON-NLS-1$
dChart.setDialSuperimposition( true );
dChart.setGridColumnCount( 2 );
dChart.setSeriesThickness( 25 );
// Title/Plot
dChart.getBlock( ).setBackground( ColorDefinitionImpl.WHITE( ) );
dChart.getPlot( )
.getClientArea( )
.setBackground( ColorDefinitionImpl.create( 255, 255, 225 ) );
dChart.getTitle( )
.getLabel( )
.getCaption( )
.setValue( "Super Imposed Meter Chart" );//$NON-NLS-1$
dChart.getTitle( ).getOutline( ).setVisible( false );
// Legend
dChart.getLegend( ).setVisible( false );
TextDataSet categoryValues = TextDataSetImpl.create( new String[]{
"Moto"} );//$NON-NLS-1$
SampleData sd = DataFactory.eINSTANCE.createSampleData( );
BaseSampleData base = DataFactory.eINSTANCE.createBaseSampleData( );
base.setDataSetRepresentation( "" );//$NON-NLS-1$
sd.getBaseSampleData( ).add( base );
OrthogonalSampleData sdOrthogonal1 = DataFactory.eINSTANCE.createOrthogonalSampleData( );
sdOrthogonal1.setDataSetRepresentation( "" );//$NON-NLS-1$
sdOrthogonal1.setSeriesDefinitionIndex( 0 );
sd.getOrthogonalSampleData( ).add( sdOrthogonal1 );
OrthogonalSampleData sdOrthogonal2 = DataFactory.eINSTANCE.createOrthogonalSampleData( );
sdOrthogonal2.setDataSetRepresentation( "" );//$NON-NLS-1$
sdOrthogonal2.setSeriesDefinitionIndex( 1 );
sd.getOrthogonalSampleData( ).add( sdOrthogonal2 );
OrthogonalSampleData sdOrthogonal3 = DataFactory.eINSTANCE.createOrthogonalSampleData( );
sdOrthogonal3.setDataSetRepresentation( "" );//$NON-NLS-1$
sdOrthogonal3.setSeriesDefinitionIndex( 2 );
sd.getOrthogonalSampleData( ).add( sdOrthogonal3 );
dChart.setSampleData( sd );
SeriesDefinition sdBase = SeriesDefinitionImpl.create( );
dChart.getSeriesDefinitions( ).add( sdBase );
Series seCategory = (Series) SeriesImpl.create( );
seCategory.setDataSet( categoryValues );
sdBase.getSeries( ).add( seCategory );
SeriesDefinition sdCity = SeriesDefinitionImpl.create( );
final Fill[] fiaOrth = {
ColorDefinitionImpl.PINK( ),
ColorDefinitionImpl.ORANGE( ),
ColorDefinitionImpl.WHITE( )
};
sdCity.getSeriesPalette( ).getEntries( ).clear( );
for ( int i = 0; i < fiaOrth.length; i++ )
{
sdCity.getSeriesPalette( ).getEntries( ).add( fiaOrth[i] );
}
// Dial 1
DialSeries seDial1 = (DialSeries) DialSeriesImpl.create( );
seDial1.setDataSet( NumberDataSetImpl.create( new double[]{
20
} ) );
seDial1.getDial( )
.setFill( GradientImpl.create( ColorDefinitionImpl.create( 225,
255,
225 ),
ColorDefinitionImpl.create( 225, 225, 255 ),
45,
false ) );
seDial1.setSeriesIdentifier( "Temperature" );//$NON-NLS-1$
seDial1.getNeedle( ).setDecorator( LineDecorator.CIRCLE_LITERAL );
seDial1.getDial( ).setStartAngle( -45 );
seDial1.getDial( ).setStopAngle( 225 );
seDial1.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setVisible( true );
seDial1.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setColor( ColorDefinitionImpl.BLACK( ) );
seDial1.getDial( )
.getMinorGrid( )
.setTickStyle( TickStyle.BELOW_LITERAL );
seDial1.getDial( )
.getScale( )
.setMin( NumberDataElementImpl.create( 0 ) );
seDial1.getDial( )
.getScale( )
.setMax( NumberDataElementImpl.create( 90 ) );
seDial1.getDial( ).getScale( ).setStep( 10 );
seDial1.getLabel( )
.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.GREY( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
seDial1.getLabel( ).setBackground( ColorDefinitionImpl.GREY( )
.brighter( ) );
DialRegion dregion1 = DialRegionImpl.create( );
dregion1.setFill( ColorDefinitionImpl.GREEN( ) );
dregion1.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.BLACK( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
dregion1.setStartValue( NumberDataElementImpl.create( 70 ) );
dregion1.setEndValue( NumberDataElementImpl.create( 90 ) );
dregion1.setInnerRadius( 40 );
dregion1.setOuterRadius( -1 );
seDial1.getDial( ).getDialRegions( ).add( dregion1 );
DialRegion dregion2 = DialRegionImpl.create( );
dregion2.setFill( ColorDefinitionImpl.YELLOW( ) );
dregion2.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.BLACK( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
dregion2.setStartValue( NumberDataElementImpl.create( 40 ) );
dregion2.setEndValue( NumberDataElementImpl.create( 70 ) );
dregion2.setOuterRadius( 70 );
seDial1.getDial( ).getDialRegions( ).add( dregion2 );
DialRegion dregion3 = DialRegionImpl.create( );
dregion3.setFill( ColorDefinitionImpl.RED( ) );
dregion3.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.BLACK( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
dregion3.setStartValue( NumberDataElementImpl.create( 0 ) );
dregion3.setEndValue( NumberDataElementImpl.create( 40 ) );
dregion3.setInnerRadius( 40 );
dregion3.setOuterRadius( 90 );
seDial1.getDial( ).getDialRegions( ).add( dregion3 );
// Dial 2
DialSeries seDial2 = (DialSeries) DialSeriesImpl.create( );
seDial2.setDataSet( NumberDataSetImpl.create( new double[]{
58
} ) );
seDial2.getDial( )
.setFill( GradientImpl.create( ColorDefinitionImpl.create( 225,
255,
225 ),
ColorDefinitionImpl.create( 225, 225, 255 ),
45,
false ) );
seDial2.setSeriesIdentifier( "Wind Speed" );//$NON-NLS-1$
seDial2.getNeedle( ).setDecorator( LineDecorator.CIRCLE_LITERAL );
seDial2.getDial( ).setStartAngle( -45 );
seDial2.getDial( ).setStopAngle( 225 );
seDial2.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setVisible( true );
seDial2.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setColor( ColorDefinitionImpl.BLACK( ) );
seDial2.getDial( )
.getMinorGrid( )
.setTickStyle( TickStyle.BELOW_LITERAL );
seDial2.getDial( )
.getScale( )
.setMin( NumberDataElementImpl.create( 0 ) );
seDial2.getDial( )
.getScale( )
.setMax( NumberDataElementImpl.create( 90 ) );
seDial2.getDial( ).getScale( ).setStep( 10 );
seDial2.getLabel( )
.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.GREY( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
seDial2.getLabel( ).setBackground( ColorDefinitionImpl.GREY( )
.brighter( ) );
seDial2.getDial( ).getDialRegions( ).add( dregion1 );
seDial2.getDial( ).getDialRegions( ).add( dregion2 );
seDial2.getDial( ).getDialRegions( ).add( dregion3 );
// Dial 3
DialSeries seDial3 = (DialSeries) DialSeriesImpl.create( );
seDial3.setDataSet( NumberDataSetImpl.create( new double[]{
80
} ) );
seDial3.getDial( )
.setFill( GradientImpl.create( ColorDefinitionImpl.create( 225,
255,
225 ),
ColorDefinitionImpl.create( 225, 225, 255 ),
45,
false ) );
seDial3.setSeriesIdentifier( "Viscosity" );//$NON-NLS-1$
seDial3.getNeedle( ).setDecorator( LineDecorator.CIRCLE_LITERAL );
seDial3.getDial( ).setStartAngle( -45 );
seDial3.getDial( ).setStopAngle( 225 );
seDial3.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setVisible( true );
seDial3.getDial( )
.getMinorGrid( )
.getTickAttributes( )
.setColor( ColorDefinitionImpl.BLACK( ) );
seDial3.getDial( )
.getMinorGrid( )
.setTickStyle( TickStyle.BELOW_LITERAL );
seDial3.getDial( )
.getScale( )
.setMin( NumberDataElementImpl.create( 0 ) );
seDial3.getDial( )
.getScale( )
.setMax( NumberDataElementImpl.create( 90 ) );
seDial3.getDial( ).getScale( ).setStep( 10 );
seDial3.getLabel( )
.setOutline( LineAttributesImpl.create( ColorDefinitionImpl.GREY( )
.darker( ),
LineStyle.SOLID_LITERAL,
1 ) );
seDial3.getLabel( ).setBackground( ColorDefinitionImpl.GREY( )
.brighter( ) );
seDial3.getDial( ).getDialRegions( ).add( dregion1 );
seDial3.getDial( ).getDialRegions( ).add( dregion2 );
seDial3.getDial( ).getDialRegions( ).add( dregion3 );
dChart.setDialSuperimposition( true );
sdBase.getSeriesDefinitions( ).add( sdCity );
sdCity.getSeries( ).add( seDial1 );
sdCity.getSeries( ).add( seDial2 );
sdCity.getSeries( ).add( seDial3 );
return dChart;
}
}
|
3e07416721e339c582622dd34544b25bb368c990
| 251 |
java
|
Java
|
design-patterns/src/main/java/org/xpdojo/designpatterns/_03_behavioral_patterns/_10_template_method/template_method/Multiply.java
|
xpdojo/java
|
66985d884439a85f963274b55b3e895e31552594
|
[
"Apache-2.0"
] | null | null | null |
design-patterns/src/main/java/org/xpdojo/designpatterns/_03_behavioral_patterns/_10_template_method/template_method/Multiply.java
|
xpdojo/java
|
66985d884439a85f963274b55b3e895e31552594
|
[
"Apache-2.0"
] | 18 |
2021-12-11T10:48:56.000Z
|
2022-03-29T01:04:08.000Z
|
design-patterns/src/main/java/org/xpdojo/designpatterns/_03_behavioral_patterns/_10_template_method/template_method/Multiply.java
|
xpdojo/java
|
66985d884439a85f963274b55b3e895e31552594
|
[
"Apache-2.0"
] | null | null | null | 27.888889 | 94 | 0.76494 | 3,072 |
package org.xpdojo.designpatterns._03_behavioral_patterns._10_template_method.template_method;
public class Multiply extends Processor {
@Override
public int getResult(int operand1, int operand2) {
return operand1 * operand2;
}
}
|
3e0741d9c2caad55a83145fc2c1bd9e9a925d1c0
| 5,147 |
java
|
Java
|
src/com/google/javascript/rhino/testing/Asserts.java
|
goelayu/closure-compiler
|
d4a085d90bdd08039e945ea5ad1883f3c01b076a
|
[
"Apache-2.0"
] | 6,240 |
2015-01-01T00:20:53.000Z
|
2022-03-31T10:33:32.000Z
|
src/com/google/javascript/rhino/testing/Asserts.java
|
goelayu/closure-compiler
|
d4a085d90bdd08039e945ea5ad1883f3c01b076a
|
[
"Apache-2.0"
] | 3,139 |
2015-01-03T02:13:16.000Z
|
2022-03-31T16:44:22.000Z
|
src/com/google/javascript/rhino/testing/Asserts.java
|
goelayu/closure-compiler
|
d4a085d90bdd08039e945ea5ad1883f3c01b076a
|
[
"Apache-2.0"
] | 1,272 |
2015-01-07T01:22:20.000Z
|
2022-03-28T07:23:29.000Z
| 36.531915 | 99 | 0.723743 | 3,073 |
/*
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Rhino code, released
* May 6, 1999.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1997-1999
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Nick Santos
* Google Inc.
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU General Public License Version 2 or later (the "GPL"), in which
* case the provisions of the GPL are applicable instead of those above. If
* you wish to allow use of your version of this file only under the terms of
* the GPL and not to allow others to use your version of this file under the
* MPL, indicate your decision by deleting the provisions above and replacing
* them with the notice and other provisions required by the GPL. If you do
* not delete the provisions above, a recipient may use your version of this
* file under either the MPL or the GPL.
*
* ***** END LICENSE BLOCK ***** */
package com.google.javascript.rhino.testing;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth.assertWithMessage;
import static com.google.javascript.rhino.testing.TypeSubject.assertType;
import static com.google.javascript.rhino.testing.TypeSubject.types;
import com.google.common.collect.Iterables;
import com.google.javascript.rhino.jstype.JSType;
import java.util.Iterator;
import org.junit.Assert;
/**
* Helper methods for making assertions about the validity of types.
* @author [email protected] (Nick Santos)
*/
public class Asserts {
private Asserts() {} // all static
public static JSType assertResolvesToSame(JSType type) {
Assert.assertSame(type, assertValidResolve(type));
return type;
}
/** @return The resolved type */
public static JSType assertValidResolve(JSType type) {
TestErrorReporter reporter = new TestErrorReporter();
JSType resolvedType = type.resolve(reporter);
assertWithMessage("JSType#resolve should not affect object equality")
.about(types())
.that(resolvedType)
.isEqualTo(type);
reporter.verifyHasEncounteredAllWarningsAndErrors();
return resolvedType;
}
public static <T extends JSType, S extends JSType> void
assertTypeCollectionEquals(Iterable<T> a, Iterable<S> b) {
assertThat(b).hasSize(Iterables.size(a));
Iterator<T> aIterator = a.iterator();
Iterator<S> bIterator = b.iterator();
while (aIterator.hasNext()) {
assertType(bIterator.next()).isEqualTo(aIterator.next());
}
}
/**
* For the given equivalent types, run all type operations that
* should have trivial solutions (getGreatestSubtype, isEquivalentTo, etc)
*/
public static void assertEquivalenceOperations(JSType a, JSType b) {
assertType(a).isEqualTo(a);
assertType(b).isEqualTo(a);
assertType(b).isEqualTo(b);
Assert.assertTrue(a.isSubtypeOf(b));
Assert.assertTrue(a.isSubtypeOf(a));
Assert.assertTrue(b.isSubtypeOf(b));
Assert.assertTrue(b.isSubtypeOf(a));
assertType(a.getGreatestSubtype(b)).isEqualTo(a);
assertType(a.getGreatestSubtype(a)).isEqualTo(a);
assertType(b.getGreatestSubtype(b)).isEqualTo(a);
assertType(b.getGreatestSubtype(a)).isEqualTo(a);
assertType(a.getLeastSupertype(b)).isEqualTo(a);
assertType(a.getLeastSupertype(a)).isEqualTo(a);
assertType(b.getLeastSupertype(b)).isEqualTo(a);
assertType(b.getLeastSupertype(a)).isEqualTo(a);
Assert.assertTrue(a.canCastTo(b));
Assert.assertTrue(a.canCastTo(a));
Assert.assertTrue(b.canCastTo(b));
Assert.assertTrue(b.canCastTo(a));
}
/**
* Assert that the given function throws a particular throwable. This method is inspired by a
* similar API in JUnit 4.13, but the compiler is currently pinned on 4.12, which doesn't include
* it.
*/
@SuppressWarnings("unchecked")
public static <T extends Throwable> T assertThrows(
Class<T> exceptionClass, ThrowingRunnable runnable) {
try {
runnable.run();
} catch (Throwable expectedException) {
assertThat(expectedException).isInstanceOf(exceptionClass);
return (T) expectedException; // Unchecked cast. J2CL doesn't support `Class::cast`.
}
assertWithMessage("Did not get expected exception: %s", exceptionClass).fail();
throw new AssertionError("Impossible");
}
/** Functional interface for use with {@link #assertThrows}. */
@FunctionalInterface
public static interface ThrowingRunnable {
void run() throws Throwable;
}
}
|
3e0741ddf2dfaf94368472fa8469c39974f05767
| 5,166 |
java
|
Java
|
src/main/java/romelo333/skills/ForgeEventHandlers.java
|
romelo333/SkillMod
|
45fb6de55f2b18b0f353ef5c8f5bbac1aae4ebc0
|
[
"MIT"
] | null | null | null |
src/main/java/romelo333/skills/ForgeEventHandlers.java
|
romelo333/SkillMod
|
45fb6de55f2b18b0f353ef5c8f5bbac1aae4ebc0
|
[
"MIT"
] | null | null | null |
src/main/java/romelo333/skills/ForgeEventHandlers.java
|
romelo333/SkillMod
|
45fb6de55f2b18b0f353ef5c8f5bbac1aae4ebc0
|
[
"MIT"
] | null | null | null | 44.153846 | 133 | 0.680023 | 3,074 |
package romelo333.skills;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.text.TextComponentString;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
import net.minecraftforge.event.entity.living.LivingDamageEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import romelo333.skills.data.PlayerSkill;
import romelo333.skills.data.PlayerSkills;
import romelo333.skills.data.Skill;
import romelo333.skills.data.SkillManager;
import romelo333.skills.proxy.CommonProxy;
import java.util.Random;
public class ForgeEventHandlers {
@SubscribeEvent
public void handleTraining(LivingAttackEvent event){
Entity source = event.getSource().getTrueSource();
EntityLivingBase target = (EntityLivingBase)event.getEntity();
if (source instanceof EntityPlayer){
handleTrainingSource(event, source);
}
if (target instanceof EntityPlayer){
handleTrainingTarget(event, target);
}
}
private void addXp(PlayerSkill playerSkill, Skill skill, Entity entity, float amount){
int xp = playerSkill.getXp();
int oldLevel = skill.calculateLevel(xp);
xp = (int) (xp + amount + 1);
int newLevel = skill.calculateLevel(xp);
playerSkill.setXp(xp);
if (oldLevel != newLevel) {
entity.sendMessage(new TextComponentString("You got " + skill.getName() + " to level " + newLevel));
}
}
private void handleTrainingSource(LivingAttackEvent event, Entity source){
PlayerSkills skills = SkillManager.get((EntityPlayer) source);
if (event.getSource().isProjectile()){
addXp(skills.get(CommonProxy.MARKSMAN), Skills.instance.registry.get(CommonProxy.MARKSMAN), source, event.getAmount());
} else{
addXp(skills.get(CommonProxy.ONEHANDED), Skills.instance.registry.get(CommonProxy.ONEHANDED), source, event.getAmount());
}
}
private void handleTrainingTarget(LivingAttackEvent event, Entity target){
PlayerSkills skills = SkillManager.get((EntityPlayer) target);
addXp(skills.get(CommonProxy.RESISTANCE), Skills.instance.registry.get(CommonProxy.RESISTANCE), target, event.getAmount());
if (((EntityPlayer) target).isActiveItemStackBlocking()){
addXp(skills.get(CommonProxy.BLOCKING), Skills.instance.registry.get(CommonProxy.BLOCKING), target, event.getAmount());
}
if (((EntityPlayer) target).getTotalArmorValue() != 0){
addXp(skills.get(CommonProxy.ARMOR), Skills.instance.registry.get(CommonProxy.ARMOR), target, event.getAmount());
}
if (target.isSprinting() || target.isInvisible() || target.isSneaking()){
addXp(skills.get(CommonProxy.ATHLETICS), Skills.instance.registry.get(CommonProxy.ATHLETICS), target, event.getAmount());
}
}
@SubscribeEvent
public void handleDamage(LivingDamageEvent event){
Entity source = event.getSource().getTrueSource();
EntityLivingBase target = (EntityLivingBase)event.getEntity();
if (source instanceof EntityPlayer){
handleSource(event, source);
}
if (target instanceof EntityPlayer){
handleTarget(event, target);
}
}
private void handleSource(LivingDamageEvent event, Entity source){
PlayerSkills skills = SkillManager.get((EntityPlayer) source);
if (event.getSource().isProjectile()){
int xp = skills.get(CommonProxy.MARKSMAN).getXp();
int level = Skills.instance.registry.get(CommonProxy.MARKSMAN).calculateLevel(xp);
event.setAmount(event.getAmount()+level/40.0f);
} else{
int xp = skills.get(CommonProxy.ONEHANDED).getXp();
int level = Skills.instance.registry.get(CommonProxy.ONEHANDED).calculateLevel(xp);
event.setAmount(event.getAmount()+level/50.0f);
}
}
private Random random = new Random();
private void handleTarget(LivingDamageEvent event, Entity target){
PlayerSkills skills = SkillManager.get((EntityPlayer) target);
if (target.isSprinting() || target.isInvisible() || target.isSneaking()){
int xp = skills.get(CommonProxy.BLOCKING).getXp();
int level = Skills.instance.registry.get(CommonProxy.BLOCKING).calculateLevel(xp);
if (random.nextInt(100) < (level/21)+1){
event.setCanceled(true);
return;
}
}
int xp = skills.get(CommonProxy.RESISTANCE).getXp();
int level = Skills.instance.registry.get(CommonProxy.RESISTANCE).calculateLevel(xp);
event.setAmount(event.getAmount()-level/50.0f);
if (((EntityPlayer) target).isActiveItemStackBlocking()){
xp = skills.get(CommonProxy.BLOCKING).getXp();
level = Skills.instance.registry.get(CommonProxy.BLOCKING).calculateLevel(xp);
event.setAmount(event.getAmount()-level/40.0f);
}
}
}
|
3e07424dadc3796f4587aae0ea382b3cee2f1614
| 610 |
java
|
Java
|
src/main/java/com/dsm/nms/global/aop/Enum.java
|
DSM-DMS/NMS-Backend-V1
|
561c47612520fad9d0a971d3f874885d4ee5d492
|
[
"MIT"
] | 9 |
2021-10-21T10:34:18.000Z
|
2021-12-27T01:31:46.000Z
|
src/main/java/com/dsm/nms/global/aop/Enum.java
|
DSM-DMS/NMS-Backend-V1
|
561c47612520fad9d0a971d3f874885d4ee5d492
|
[
"MIT"
] | 63 |
2021-10-21T09:49:19.000Z
|
2021-12-13T14:20:04.000Z
|
src/main/java/com/dsm/nms/global/aop/Enum.java
|
DSM-DMS/NMS-Backend-V1
|
561c47612520fad9d0a971d3f874885d4ee5d492
|
[
"MIT"
] | 2 |
2021-11-17T16:50:30.000Z
|
2021-12-20T11:27:04.000Z
| 32.105263 | 69 | 0.752459 | 3,075 |
package com.dsm.nms.global.aop;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Constraint(validatedBy = EnumValidator.class)
@Target({FIELD})
@Retention(RUNTIME)
public @interface Enum {
String message() default "Invalid value. This is not permitted.";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
Class<? extends java.lang.Enum<?>> enumClass();
}
|
3e0742d5e37e04a482ae8672852a1d77f31bea39
| 5,803 |
java
|
Java
|
camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
|
ctron/de.dentrassi.camel.milo
|
21925143e48717321b17e35847d42ed190a9eaca
|
[
"Apache-2.0"
] | 6 |
2016-09-20T10:36:28.000Z
|
2019-06-03T06:53:32.000Z
|
camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
|
ctron/de.dentrassi.camel.milo
|
21925143e48717321b17e35847d42ed190a9eaca
|
[
"Apache-2.0"
] | 10 |
2016-09-20T11:52:24.000Z
|
2017-03-02T10:35:43.000Z
|
camel-milo/src/main/java/org/apache/camel/component/milo/client/MiloClientEndpoint.java
|
ctron/de.dentrassi.camel.milo
|
21925143e48717321b17e35847d42ed190a9eaca
|
[
"Apache-2.0"
] | 7 |
2016-07-20T14:31:58.000Z
|
2019-02-21T06:09:32.000Z
| 23.888889 | 239 | 0.734195 | 3,076 |
/*
* Copyright (C) 2016 Jens Reimann <[email protected]>
*
* 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.apache.camel.component.milo.client;
import static org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.Unsigned.ushort;
import java.util.Objects;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.component.milo.NamespaceId;
import org.apache.camel.component.milo.PartialNodeId;
import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.spi.UriPath;
import org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId;
@UriEndpoint(scheme = "milo-client", syntax = "milo-client:tcp://user:password@host:port/path/to/service?itemId=item.id&namespaceUri=urn:foo:bar", title = "Milo based OPC UA Client", consumerClass = MiloClientConsumer.class, label = "iot")
public class MiloClientEndpoint extends DefaultEndpoint implements MiloClientItemConfiguration {
/**
* The OPC UA server endpoint
*/
@UriPath
@Metadata(required = "true")
private final String endpointUri;
/**
* The node ID as string ID **deprecated**
*
* @deprecated Use "node" instead
*/
@UriParam
@Deprecated
private String nodeId;
/**
* The namespace as URI **deprecated**
*
* @deprecated Use "node" instead
*/
@UriParam
@Deprecated
private String namespaceUri;
/**
* The namespace as numeric index **deprecated**
*
* @deprecated Use "node" instead
*/
@UriParam
@Deprecated
private Integer namespaceIndex;
/**
* The node definition (see Node ID)
*/
@UriParam
private ExpandedNodeId node;
/**
* The sampling interval in milliseconds
*/
@UriParam
private Double samplingInterval;
/**
* The client configuration
*/
@UriParam
private MiloClientConfiguration client;
/**
* Default "await" setting for writes
*/
@UriParam
private boolean defaultAwaitWrites = false;
private final MiloClientConnection connection;
private final MiloClientComponent component;
public MiloClientEndpoint(final String uri, final MiloClientComponent component,
final MiloClientConnection connection, final String endpointUri) {
super(uri, component);
Objects.requireNonNull(component);
Objects.requireNonNull(connection);
Objects.requireNonNull(endpointUri);
this.endpointUri = endpointUri;
this.component = component;
this.connection = connection;
}
@Override
protected void doStart() throws Exception {
super.doStart();
}
@Override
protected void doStop() throws Exception {
this.component.disposed(this);
super.doStop();
}
@Override
public Producer createProducer() throws Exception {
return new MiloClientProducer(this, this.connection, this, this.defaultAwaitWrites);
}
@Override
public Consumer createConsumer(final Processor processor) throws Exception {
return new MiloClientConsumer(this, processor, this.connection, this);
}
@Override
public boolean isSingleton() {
return true;
}
public MiloClientConnection getConnection() {
return this.connection;
}
// item configuration
@Override
public PartialNodeId makePartialNodeId() {
PartialNodeId result = null;
if (this.node != null) {
result = PartialNodeId.fromExpandedNodeId(this.node);
}
if (result == null && this.nodeId != null) {
result = new PartialNodeId(this.nodeId);
}
if (result == null) {
throw new IllegalStateException("Missing or invalid node id configuration");
} else {
return result;
}
}
@Override
public NamespaceId makeNamespaceId() {
NamespaceId result = null;
if (this.node != null) {
result = NamespaceId.fromExpandedNodeId(this.node);
}
if (result == null && this.namespaceIndex != null) {
result = new NamespaceId(ushort(this.namespaceIndex));
}
if (result == null && this.namespaceUri != null) {
result = new NamespaceId(this.namespaceUri);
}
if (result == null) {
throw new IllegalStateException("Missing or invalid node id configuration");
} else {
return result;
}
}
public String getNodeId() {
return this.nodeId;
}
public void setNodeId(final String nodeId) {
this.nodeId = nodeId;
}
public String getNamespaceUri() {
return this.namespaceUri;
}
public void setNamespaceUri(final String namespaceUri) {
this.namespaceUri = namespaceUri;
}
public Integer getNamespaceIndex() {
return this.namespaceIndex;
}
public void setNamespaceIndex(final int namespaceIndex) {
this.namespaceIndex = namespaceIndex;
}
public void setNode(final String node) {
if (node == null) {
this.node = null;
} else {
this.node = ExpandedNodeId.parse(node);
}
}
public String getNode() {
if (this.node != null) {
return this.node.toParseableString();
} else {
return null;
}
}
@Override
public Double getSamplingInterval() {
return this.samplingInterval;
}
public void setSamplingInterval(final Double samplingInterval) {
this.samplingInterval = samplingInterval;
}
public boolean isDefaultAwaitWrites() {
return this.defaultAwaitWrites;
}
public void setDefaultAwaitWrites(final boolean defaultAwaitWrites) {
this.defaultAwaitWrites = defaultAwaitWrites;
}
}
|
3e07430a8083e21aa25676c19463a5b4a7c3dd16
| 334 |
java
|
Java
|
mobile_app1/module733/src/main/java/module733packageJava0/Foo155.java
|
HiWong/android-build-eval
|
d909ab37bc8d5d3a188ba9c9f0855f846f6f3af6
|
[
"Apache-2.0"
] | 70 |
2021-01-22T16:48:06.000Z
|
2022-02-16T10:37:33.000Z
|
mobile_app1/module733/src/main/java/module733packageJava0/Foo155.java
|
HiWong/android-build-eval
|
d909ab37bc8d5d3a188ba9c9f0855f846f6f3af6
|
[
"Apache-2.0"
] | 16 |
2021-01-22T20:52:52.000Z
|
2021-08-09T17:51:24.000Z
|
mobile_app1/module733/src/main/java/module733packageJava0/Foo155.java
|
HiWong/android-build-eval
|
d909ab37bc8d5d3a188ba9c9f0855f846f6f3af6
|
[
"Apache-2.0"
] | 5 |
2021-01-26T13:53:49.000Z
|
2021-08-11T20:10:57.000Z
| 11.928571 | 46 | 0.58982 | 3,077 |
package module733packageJava0;
import java.lang.Integer;
public class Foo155 {
Integer int0;
public void foo0() {
new module733packageJava0.Foo154().foo4();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
}
|
3e074349e1d74f6ee028cabda8e89277493c45dd
| 683 |
java
|
Java
|
kafka-plain-java/src/main/java/com/sme/kafka/plain/util/PropertiesBuilder.java
|
StepanMelnik/Kafka_Examples
|
264ab8079ebb73f9ba2865a05bf02b3be0cbcd32
|
[
"Apache-2.0"
] | null | null | null |
kafka-plain-java/src/main/java/com/sme/kafka/plain/util/PropertiesBuilder.java
|
StepanMelnik/Kafka_Examples
|
264ab8079ebb73f9ba2865a05bf02b3be0cbcd32
|
[
"Apache-2.0"
] | null | null | null |
kafka-plain-java/src/main/java/com/sme/kafka/plain/util/PropertiesBuilder.java
|
StepanMelnik/Kafka_Examples
|
264ab8079ebb73f9ba2865a05bf02b3be0cbcd32
|
[
"Apache-2.0"
] | null | null | null | 19.514286 | 59 | 0.5959 | 3,078 |
package com.sme.kafka.plain.util;
import java.util.Properties;
/**
* The builder to create {@link Properties} instance.
*/
public final class PropertiesBuilder<K, V>
{
private final Properties properties = new Properties();
/**
* Add a row into properties.
*
* @param key The key;
* @param value The value;
* @return Returns builder.
*/
public PropertiesBuilder<K, V> put(K key, V value)
{
properties.put(key, value);
return this;
}
/**
* Return created properties.
*
* @return The created properties instance.
*/
public Properties build()
{
return properties;
}
}
|
3e0743b6ee1a4ef9b1f98043a7764dd283f5b59f
| 17,919 |
java
|
Java
|
chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerTest.java
|
sarang-apps/darshan_browser
|
173649bb8a7c656dc60784d19e7bb73e07c20daa
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null |
chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerTest.java
|
sarang-apps/darshan_browser
|
173649bb8a7c656dc60784d19e7bb73e07c20daa
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null |
chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/indicator/OfflineIndicatorControllerTest.java
|
sarang-apps/darshan_browser
|
173649bb8a7c656dc60784d19e7bb73e07c20daa
|
[
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | 40.267416 | 100 | 0.686087 | 3,079 |
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.offlinepages.indicator;
import android.os.SystemClock;
import android.support.test.InstrumentationRegistry;
import android.support.test.filters.MediumTest;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.ApplicationState;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.download.DownloadActivity;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.browser.offlinepages.ClientId;
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.chrome.test.util.ActivityUtils;
import org.chromium.chrome.test.util.ChromeTabUtils;
import org.chromium.chrome.test.util.MenuUtils;
import org.chromium.chrome.test.util.browser.Features;
import org.chromium.components.embedder_support.util.UrlConstants;
import org.chromium.components.offlinepages.SavePageResult;
import org.chromium.content_public.browser.LoadUrlParams;
import org.chromium.content_public.browser.test.util.Criteria;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.net.NetworkChangeNotifier;
import org.chromium.net.test.EmbeddedTestServer;
import org.chromium.ui.base.PageTransition;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
/** Unit tests for offline indicator interacting with chrome activity. */
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
// TODO(jianli): Add test for disabled feature.
public class OfflineIndicatorControllerTest {
@Rule
public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
new ChromeActivityTestRule<>(ChromeActivity.class);
private static final String TEST_PAGE = "/chrome/test/data/android/test.html";
private static final int TIMEOUT_MS = 5000;
private static final ClientId CLIENT_ID =
new ClientId(OfflinePageBridge.DOWNLOAD_NAMESPACE, "1234");
private boolean mIsConnected = true;
@Before
public void setUp() throws Exception {
// ChromeActivityTestRule disables offline indicator feature. We want to enable it to do
// our own testing.
Features.getInstance().enable(ChromeFeatureList.OFFLINE_INDICATOR);
OfflineIndicatorController.setTimeToWaitForStableOfflineForTesting(1);
// This test only cares about whether the network is disconnected or not. So there is no
// need to do http probes to validate the network in ConnectivityDetector.
ConnectivityDetector.setDelegateForTesting(new ConnectivityDetectorDelegateStub(
ConnectivityDetector.ConnectionState.NONE, true /*shouldSkipHttpProbes*/));
mActivityTestRule.startMainActivityOnBlankPage();
TestThreadUtils.runOnUiThreadBlocking(() -> {
if (!NetworkChangeNotifier.isInitialized()) {
NetworkChangeNotifier.init();
}
NetworkChangeNotifier.forceConnectivityState(true);
OfflineIndicatorController.initialize();
OfflineIndicatorController.getInstance()
.getConnectivityDetectorForTesting()
.setConnectionState(ConnectivityDetector.ConnectionState.VALIDATED);
});
}
@Test
@MediumTest
public void testShowOfflineIndicatorOnNTPWhenOffline() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Load new tab page.
loadPage(UrlConstants.NTP_URL);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
}
@Test
@MediumTest
public void testShowOfflineIndicatorOnRegularPageWhenOffline() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Load a page.
loadPage(testUrl);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
}
@Test
@MediumTest
public void testHideOfflineIndicatorWhenBackToOnline() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Load a page.
loadPage(testUrl);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
// Reconnect the network.
setNetworkConnectivity(true);
// Offline indicator should go away.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
}
@Test
@MediumTest
public void testDoNotShowSubsequentOfflineIndicatorWhenFlaky() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Load a page.
loadPage(testUrl);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
// Reconnect the network.
setNetworkConnectivity(true);
// Offline indicator should go away.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
// Disconnect the network.
setNetworkConnectivity(false);
// Subsequent offline indicator should not be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
// Reconnect the network and keep it for some time before disconnecting it.
setNetworkConnectivity(true);
SystemClock.sleep(2000);
setNetworkConnectivity(false);
// Subsequent offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
}
@Test
@MediumTest
public void testDoNotShowOfflineIndicatorOnErrorPageWhenOffline() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Stop the server and also disconnect the network.
testServer.shutdownAndWaitUntilComplete();
setNetworkConnectivity(false);
// Load an error page.
loadPage(testUrl);
// Reconnect the network.
setNetworkConnectivity(true);
// Offline indicator should not be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should not be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
}
@Test
@MediumTest
public void testDoNotShowOfflineIndicatorOnOfflinePageWhenOffline() throws Exception {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
Tab tab = mActivityTestRule.getActivity().getActivityTab();
// Save an offline page.
savePage(testUrl);
Assert.assertFalse(isOfflinePage(tab));
// Force to load the offline page.
loadPageWithoutWaiting(testUrl, "X-Chrome-offline: reason=download");
waitForPageLoaded(testUrl);
Assert.assertTrue(isOfflinePage(tab));
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should not be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
}
@Test
@MediumTest
public void testDoNotShowOfflineIndicatorOnDownloadsWhenOffline() {
if (mActivityTestRule.getActivity().isTablet()) return;
DownloadActivity downloadActivity = ActivityUtils.waitForActivity(
InstrumentationRegistry.getInstrumentation(), DownloadActivity.class,
new MenuUtils.MenuActivityTrigger(InstrumentationRegistry.getInstrumentation(),
mActivityTestRule.getActivity(), R.id.downloads_menu_id));
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should not be shown.
checkOfflineIndicatorVisibility(downloadActivity, false);
}
@Test
@MediumTest
public void testDoNotShowOfflineIndicatorOnPageLoadingWhenOffline() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL("/slow?1");
// Load a page without waiting it to finish.
loadPageWithoutWaiting(testUrl, null);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should not be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
// Wait for the page to finish loading.
waitForPageLoaded(testUrl);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
}
@Test
@MediumTest
public void testReshowOfflineIndicatorWhenResumed() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Load a page.
loadPage(testUrl);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
// Hide offline indicator.
hideOfflineIndicator(mActivityTestRule.getActivity());
// Simulate switching to other app and then coming back.
setApplicationState(ApplicationState.HAS_STOPPED_ACTIVITIES);
setApplicationState(ApplicationState.HAS_RUNNING_ACTIVITIES);
// Offline indicator should be shown again.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
}
@Test
@MediumTest
public void testDoNotShowOfflineIndicatorWhenTemporarilyPaused() {
EmbeddedTestServer testServer =
EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
String testUrl = testServer.getURL(TEST_PAGE);
// Load a page.
loadPage(testUrl);
// Disconnect the network.
setNetworkConnectivity(false);
// Offline indicator should be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), true);
// Hide offline indicator.
hideOfflineIndicator(mActivityTestRule.getActivity());
// The paused state can be set when the activity is temporarily covered by another
// activity's Fragment. So switching to this state temporarily should not bring back
// the offline indicator.
setApplicationState(ApplicationState.HAS_PAUSED_ACTIVITIES);
setApplicationState(ApplicationState.HAS_RUNNING_ACTIVITIES);
// Offline indicator should not be shown.
checkOfflineIndicatorVisibility(mActivityTestRule.getActivity(), false);
}
private void setNetworkConnectivity(boolean connected) {
mIsConnected = connected;
TestThreadUtils.runOnUiThreadBlocking(() -> {
NetworkChangeNotifier.forceConnectivityState(connected);
OfflineIndicatorController.getInstance()
.getConnectivityDetectorForTesting()
.setConnectionState(connected
? ConnectivityDetector.ConnectionState.VALIDATED
: ConnectivityDetector.ConnectionState.DISCONNECTED);
});
}
private void setApplicationState(int newState) {
TestThreadUtils.runOnUiThreadBlocking(() -> {
OfflineIndicatorController.getInstance().onApplicationStateChange(newState);
});
}
private void loadPage(String pageUrl) {
Tab tab = mActivityTestRule.getActivity().getActivityTab();
mActivityTestRule.loadUrl(pageUrl);
Assert.assertEquals(pageUrl, tab.getUrlString());
if (mIsConnected) {
Assert.assertFalse(isErrorPage(tab));
Assert.assertFalse(isOfflinePage(tab));
} else {
Assert.assertTrue(isErrorPage(tab) || isOfflinePage(tab));
}
}
private void loadPageWithoutWaiting(String pageUrl, String headers) {
Tab tab = mActivityTestRule.getActivity().getActivityTab();
TestThreadUtils.runOnUiThreadBlocking(() -> {
LoadUrlParams params = new LoadUrlParams(
pageUrl, PageTransition.TYPED | PageTransition.FROM_ADDRESS_BAR);
if (headers != null) {
params.setVerbatimHeaders(headers);
}
tab.loadUrl(params);
});
}
private void waitForPageLoaded(String pageUrl) {
Tab tab = mActivityTestRule.getActivity().getActivityTab();
ChromeTabUtils.waitForTabPageLoaded(tab, pageUrl);
ChromeTabUtils.waitForInteractable(tab);
InstrumentationRegistry.getInstrumentation().waitForIdleSync();
}
private void savePage(String url) throws InterruptedException {
mActivityTestRule.loadUrl(url);
final Semaphore semaphore = new Semaphore(0);
TestThreadUtils.runOnUiThreadBlocking(() -> {
Profile profile = Profile.getLastUsedRegularProfile();
OfflinePageBridge offlinePageBridge = OfflinePageBridge.getForProfile(profile);
offlinePageBridge.savePage(mActivityTestRule.getWebContents(), CLIENT_ID,
new OfflinePageBridge.SavePageCallback() {
@Override
public void onSavePageDone(int savePageResult, String url, long offlineId) {
Assert.assertEquals(
"Save failed.", SavePageResult.SUCCESS, savePageResult);
semaphore.release();
}
});
});
Assert.assertTrue(semaphore.tryAcquire(TIMEOUT_MS, TimeUnit.MILLISECONDS));
}
private static void checkOfflineIndicatorVisibility(
SnackbarManageable activity, boolean visible) {
CriteriaHelper.pollUiThread(
new Criteria(visible ? "Offline indicator not shown" : "Offline indicator shown") {
@Override
public boolean isSatisfied() {
return visible == isShowingOfflineIndicator();
}
private boolean isShowingOfflineIndicator() {
if (OfflineIndicatorController.isUsingTopSnackbar()) {
TopSnackbarManager snackbarManager =
OfflineIndicatorController.getInstance()
.getTopSnackbarManagerForTesting();
return snackbarManager.isShowing();
} else {
SnackbarManager snackbarManager = activity.getSnackbarManager();
if (!snackbarManager.isShowing()) return false;
return snackbarManager.getCurrentSnackbarForTesting().getController()
== OfflineIndicatorController.getInstance();
}
}
});
}
private static void hideOfflineIndicator(ChromeActivity activity) {
TestThreadUtils.runOnUiThreadBlocking(
() -> { OfflineIndicatorController.getInstance().hideOfflineIndicator(activity); });
}
private static boolean isErrorPage(final Tab tab) {
final boolean[] isShowingError = new boolean[1];
TestThreadUtils.runOnUiThreadBlocking(
() -> { isShowingError[0] = tab.isShowingErrorPage(); });
return isShowingError[0];
}
private static boolean isOfflinePage(final Tab tab) {
final boolean[] isOffline = new boolean[1];
TestThreadUtils.runOnUiThreadBlocking(
() -> { isOffline[0] = OfflinePageUtils.isOfflinePage(tab); });
return isOffline[0];
}
}
|
3e0743b7d118de759f10305b5a3f59dd3fa876f9
| 722 |
java
|
Java
|
src/io/github/yagoag/main/Stack.java
|
yagoag/data-structures
|
d209752a6831511066c2eb4b793682c6809549e4
|
[
"MIT"
] | null | null | null |
src/io/github/yagoag/main/Stack.java
|
yagoag/data-structures
|
d209752a6831511066c2eb4b793682c6809549e4
|
[
"MIT"
] | null | null | null |
src/io/github/yagoag/main/Stack.java
|
yagoag/data-structures
|
d209752a6831511066c2eb4b793682c6809549e4
|
[
"MIT"
] | null | null | null | 14.734694 | 33 | 0.537396 | 3,080 |
package io.github.yagoag.main;
public class Stack<E> {
Node<E> top;
public Stack() {
top = null;
}
public boolean isEmpty() {
return top == null;
}
public E peek() {
if (top == null) return null;
return top.getValue();
}
public E pop() {
if (top == null) return null;
E popped = top.getValue();
top = top.getNext();
return popped;
}
public void add(E value) {
top = new Node<>(value, top);
}
private class Node<E> {
E value;
Node<E> next;
Node(E value, Node<E> next) {
this.value = value;
this.next = next;
}
public E getValue() {
return value;
}
public Node<E> getNext() {
return next;
}
}
}
|
3e0743f5d9733e2ffb6a20c1e43ccad8385037a3
| 4,420 |
java
|
Java
|
src/main/java/com/xceptance/xlt/engine/scripting/docgen/ScriptDocGeneratorConfiguration.java
|
Xceptance/XLT
|
26b087bd79762db0c4ffd7ba884a8ebd64c92eb7
|
[
"Apache-2.0"
] | 39 |
2020-02-04T10:18:34.000Z
|
2022-02-28T00:25:11.000Z
|
src/main/java/com/xceptance/xlt/engine/scripting/docgen/ScriptDocGeneratorConfiguration.java
|
Xceptance/XLT
|
26b087bd79762db0c4ffd7ba884a8ebd64c92eb7
|
[
"Apache-2.0"
] | 150 |
2020-02-04T10:21:28.000Z
|
2022-03-30T09:25:13.000Z
|
src/main/java/com/xceptance/xlt/engine/scripting/docgen/ScriptDocGeneratorConfiguration.java
|
Xceptance/XLT
|
26b087bd79762db0c4ffd7ba884a8ebd64c92eb7
|
[
"Apache-2.0"
] | 5 |
2020-04-21T12:14:39.000Z
|
2021-12-10T10:13:03.000Z
| 30.909091 | 113 | 0.650226 | 3,081 |
/*
* Copyright (c) 2005-2021 Xceptance Software Technologies GmbH
*
* 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 com.xceptance.xlt.engine.scripting.docgen;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import com.xceptance.common.util.AbstractConfiguration;
import com.xceptance.xlt.engine.XltExecutionContext;
/**
* Configuration used by {@link ScriptDocGenerator}.
*
* @author Hartmut Arlt (Xceptance Software Technologies GmbH)
*/
public class ScriptDocGeneratorConfiguration extends AbstractConfiguration
{
private final Map<String, String> templates;
private final File templateDir;
private final File resourceDir;
public ScriptDocGeneratorConfiguration(final Properties commandLineProperties) throws IOException
{
final File configDirectory = XltExecutionContext.getCurrent().getXltConfigDir();
{
loadProperties(new File(configDirectory, "scriptdocgenerator.properties"));
}
{
if (commandLineProperties != null)
{
addProperties(commandLineProperties);
}
}
File templateDirectory = getFileProperty("com.xceptance.xlt.scriptdocgenerator.templateDirectory");
if (!templateDirectory.isAbsolute())
{
templateDirectory = new File(configDirectory, templateDirectory.getPath());
}
isReadableDir(templateDirectory, "Template directory");
File resourceDirectory = getFileProperty("com.xceptance.xlt.scriptdocgenerator.resourceDirectory");
if (!resourceDirectory.isAbsolute())
{
resourceDirectory = new File(configDirectory, resourceDirectory.getPath());
}
isReadableDir(resourceDirectory, "Resource directory");
templateDir = templateDirectory;
resourceDir = resourceDirectory;
templates = readTemplateMapping();
}
private Map<String, String> readTemplateMapping()
{
final HashMap<String, String> mapping = new HashMap<String, String>();
final String prefix = "com.xceptance.xlt.scriptdocgenerator.templates.";
for (final String s : getPropertyKeyFragment(prefix))
{
final String prop = prefix + s;
final File templateFile = getFileProperty(prop + ".templateFileName");
final File outputFile = getFileProperty(prop + ".outputFileName");
mapping.put(templateFile.getPath(), outputFile.getPath());
}
return mapping;
}
/**
* @return the templateDir
*/
public File getTemplateDir()
{
return templateDir;
}
/**
* @return the resourceDir
*/
public File getResourceDir()
{
return resourceDir;
}
/**
* @return the templates
*/
public Map<String, String> getTemplates()
{
return templates;
}
/**
* Tests if the given directory exists, is a directory and can be read.
*
* @param dir
* the directory to check
* @param dirDesc
* the description of the given directory
* @throws IllegalArgumentException
* when the given directory does not exist, is not a directory or cannot be read
*/
private static void isReadableDir(final File dir, final String dirDesc)
{
if (!dir.exists())
{
throw new IllegalArgumentException(dirDesc + " '" + dir.getAbsolutePath() + "' does not exist.");
}
if (!dir.isDirectory())
{
throw new IllegalArgumentException(dirDesc + " '" + dir.getAbsolutePath() + "' is not a directory.");
}
if (!dir.canRead())
{
throw new IllegalArgumentException(dirDesc + " '" + dir.getAbsolutePath() + "' cannot be read.");
}
}
}
|
3e0744d7b10a48c5a0afbc322742795df7d0c564
| 5,138 |
java
|
Java
|
src/edu/gatech/pmase/capstone/awesome/objects/enums/WeightingCategory.java
|
astropcr/pmasecapstone
|
76e5ef64ae2a1b21f913ce269806b844c53b89c8
|
[
"MIT"
] | null | null | null |
src/edu/gatech/pmase/capstone/awesome/objects/enums/WeightingCategory.java
|
astropcr/pmasecapstone
|
76e5ef64ae2a1b21f913ce269806b844c53b89c8
|
[
"MIT"
] | 30 |
2016-07-22T08:43:46.000Z
|
2016-07-26T01:07:06.000Z
|
src/edu/gatech/pmase/capstone/awesome/objects/enums/WeightingCategory.java
|
astropcr/pmasecapstone
|
76e5ef64ae2a1b21f913ce269806b844c53b89c8
|
[
"MIT"
] | null | null | null | 29.872093 | 80 | 0.616193 | 3,082 |
/*
* The MIT License
*
* Copyright 2016 Georgia Tech PMASE 2014 Cohort Team Awesome.
*
* 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.
*/
package edu.gatech.pmase.capstone.awesome.objects.enums;
import java.util.Arrays;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
/**
* Effect that a disaster can create.
*/
public enum WeightingCategory {
/**
*
*/
UNKNOWN(0, "Unknown", 0.0),
/**
*
*/
EXTREMELY_LESS(1, "Extremely Less Important", 0.1),
/**
*
*/
SIGNIFICANTLY_LESS(2, "Significantly Less Important", 0.2),
/**
*
*/
EQUALLY(3, "Equally Important", 1.0),
/**
*
*/
SIGNIFICANTLY_MORE(4, "Significantly More Important", 5.0),
/**
*
*/
EXTREMELY_MORE(5, "Extremely More Important", 10.0);
/**
* The ID of the Weighting Category.
*/
public int id;
/**
* Reader Friendly Label.
*/
public final String label;
/**
* The value of the Weighting Category.
*/
public final double value;
/**
* Constructor
*
* @param inId the id of the disaster effect
* @param inLabel the reader friendly label to use
* @param inValue the value of the weighting category
*/
private WeightingCategory(final int inId, final String inLabel,
final double inValue) {
this.label = inLabel;
this.id = inId;
this.value = inValue;
}
/**
* Given the ID, returns the associated WeightingCategory.
*
* @param inId the ID to find by
*
* @return the given Weighting Category. If none found to match ID, returns
* {@link WeightingCategory#UNKNOWN}.
*/
public static WeightingCategory getCategoriesById(final int inId) {
WeightingCategory effect = WeightingCategory.UNKNOWN;
final Optional<WeightingCategory> result = Arrays.asList(
WeightingCategory.values())
.stream()
.filter(eff -> (eff.id == inId))
.findFirst();
if (result.isPresent()) {
effect = result.get();
}
return effect;
}
/**
* Given the label, returns the associated WeightingCategory.
*
* @param inLabel the label to find by
*
* @return the given Weighting Category. If none found to match label,
* returns {@link WeightingCategory#UNKNOWN}.
*/
public static WeightingCategory getCategoriesByLabel(final String inLabel) {
WeightingCategory effect = WeightingCategory.UNKNOWN;
final Optional<WeightingCategory> result = Arrays.asList(
WeightingCategory.values())
.stream()
.filter(eff -> eff.label.equals(inLabel))
.findFirst();
if (result.isPresent()) {
effect = result.get();
}
return effect;
}
/**
* Given the Value, returns the associated WeightingCategory.
*
* @param inValue the value to find by
*
* @return the given Weighting Category. If none found to match value,
* returns {@link WeightingCategory#UNKNOWN}.
*/
public static WeightingCategory getCategoriesByValue(final double inValue) {
WeightingCategory effect = WeightingCategory.UNKNOWN;
final Optional<WeightingCategory> result = Arrays.asList(
WeightingCategory.values())
.stream()
.filter(eff -> eff.value == inValue)
.findFirst();
if (result.isPresent()) {
effect = result.get();
}
return effect;
}
/**
* Returns a Set labels.
*
* @return the Set of Weighting Category labels
*/
public static Set<String> getCategoryLabels() {
return Arrays.asList(WeightingCategory.values())
.stream().filter(eff -> eff.id != WeightingCategory.UNKNOWN.id)
.map(eff -> eff.label)
.collect(Collectors.toSet());
}
}
|
3e0746d4d34a73d7301376613b8b1a8691156839
| 2,562 |
java
|
Java
|
app/src/main/java/com/obs/services/model/fs/RenameRequest.java
|
lusongyan/huaweicloud-sdk-java-obs
|
813112eb4e38e863fd69d52f45e071d679298f54
|
[
"ECL-2.0",
"Apache-2.0"
] | 95 |
2019-02-13T07:29:42.000Z
|
2022-03-30T15:42:01.000Z
|
app/src/main/java/com/obs/services/model/fs/RenameRequest.java
|
lusongyan/huaweicloud-sdk-java-obs
|
813112eb4e38e863fd69d52f45e071d679298f54
|
[
"ECL-2.0",
"Apache-2.0"
] | 68 |
2019-03-06T03:18:58.000Z
|
2022-03-28T10:39:34.000Z
|
app/src/main/java/com/obs/services/model/fs/RenameRequest.java
|
lusongyan/huaweicloud-sdk-java-obs
|
813112eb4e38e863fd69d52f45e071d679298f54
|
[
"ECL-2.0",
"Apache-2.0"
] | 83 |
2019-02-21T07:20:57.000Z
|
2022-02-16T15:31:01.000Z
| 23.081081 | 84 | 0.606167 | 3,083 |
/**
* Copyright 2019 Huawei Technologies Co.,Ltd.
* 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 com.obs.services.model.fs;
import com.obs.services.model.GenericRequest;
/**
* Parameters in a request for renaming a file or folder
*
*/
public class RenameRequest extends GenericRequest {
private String bucketName;
private String objectKey;
private String newObjectKey;
public RenameRequest() {
}
/**
* Constructor
*
* @param bucketName
* Bucket name
* @param objectKey
* File or folder name
* @param newObjectKey
* New file or folder name
*/
public RenameRequest(String bucketName, String objectKey, String newObjectKey) {
super();
this.bucketName = bucketName;
this.objectKey = objectKey;
this.newObjectKey = newObjectKey;
}
/**
* Obtain the bucket name.
*
* @return Bucket name
*/
public String getBucketName() {
return bucketName;
}
/**
* Set the bucket name.
*
* @param bucketName
* Bucket name
*/
public void setBucketName(String bucketName) {
this.bucketName = bucketName;
}
/**
* Obtain the file or folder name.
*
* @return File or folder name
*/
public String getObjectKey() {
return objectKey;
}
/**
* Set the file or folder name.
*
* @param objectKey
* File or folder name
*
*/
public void setObjectKey(String objectKey) {
this.objectKey = objectKey;
}
/**
* Obtain the new file or folder name.
*
* @return New file or folder name
*/
public String getNewObjectKey() {
return newObjectKey;
}
/**
* Set the new file or folder name.
*
* @param newObjectKey
* New file or folder name
*/
public void setNewObjectKey(String newObjectKey) {
this.newObjectKey = newObjectKey;
}
}
|
3e074704fdd0126f74236831f8d3449d0f07bb6c
| 1,178 |
java
|
Java
|
psl-core/src/test/java/org/linqs/psl/application/learning/weight/maxlikelihood/LazyMaxLikelihoodMPETest.java
|
Lammatian/psl
|
98b1cb567da1705500ca9d5262bd53769b352e7e
|
[
"Apache-2.0"
] | 267 |
2015-01-14T16:25:09.000Z
|
2021-12-29T00:03:21.000Z
|
psl-core/src/test/java/org/linqs/psl/application/learning/weight/maxlikelihood/LazyMaxLikelihoodMPETest.java
|
Lammatian/psl
|
98b1cb567da1705500ca9d5262bd53769b352e7e
|
[
"Apache-2.0"
] | 292 |
2015-07-28T19:36:54.000Z
|
2022-01-07T04:51:13.000Z
|
psl-core/src/test/java/org/linqs/psl/application/learning/weight/maxlikelihood/LazyMaxLikelihoodMPETest.java
|
Lammatian/psl
|
98b1cb567da1705500ca9d5262bd53769b352e7e
|
[
"Apache-2.0"
] | 94 |
2015-01-03T19:36:34.000Z
|
2021-08-18T13:21:44.000Z
| 40.62069 | 109 | 0.777589 | 3,084 |
/*
* This file is part of the PSL software.
* Copyright 2011-2015 University of Maryland
* Copyright 2013-2019 The Regents of the University of California
*
* 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.linqs.psl.application.learning.weight.maxlikelihood;
import org.linqs.psl.application.learning.weight.WeightLearningApplication;
import org.linqs.psl.application.learning.weight.WeightLearningTest;
public class LazyMaxLikelihoodMPETest extends WeightLearningTest {
@Override
protected WeightLearningApplication getWLA() {
return new LazyMaxLikelihoodMPE(info.model.getRules(), weightLearningTrainDB, weightLearningTruthDB);
}
}
|
3e0748f2ca3543fd078d3ce836038e8cfb100acf
| 3,196 |
java
|
Java
|
tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
|
Keneral/adevelopment
|
d14130b5de871633cffc5b9d4062d425632070f4
|
[
"Unlicense"
] | 11 |
2020-06-01T18:47:54.000Z
|
2021-10-08T02:58:27.000Z
|
tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
|
Keneral/adevelopment
|
d14130b5de871633cffc5b9d4062d425632070f4
|
[
"Unlicense"
] | null | null | null |
tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
|
Keneral/adevelopment
|
d14130b5de871633cffc5b9d4062d425632070f4
|
[
"Unlicense"
] | 5 |
2017-12-14T19:37:14.000Z
|
2019-07-18T01:18:06.000Z
| 28.535714 | 80 | 0.637672 | 3,085 |
/*
* Copyright (C) 2008 Google Inc.
*
* 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 com.android.demo.notepad3;
import android.app.Activity;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class NoteEdit extends Activity {
private EditText mTitleText;
private EditText mBodyText;
private Long mRowId;
private NotesDbAdapter mDbHelper;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mDbHelper = new NotesDbAdapter(this);
mDbHelper.open();
setContentView(R.layout.note_edit);
setTitle(R.string.edit_note);
mTitleText = (EditText) findViewById(R.id.title);
mBodyText = (EditText) findViewById(R.id.body);
Button confirmButton = (Button) findViewById(R.id.confirm);
mRowId = (savedInstanceState == null) ? null :
(Long) savedInstanceState.getSerializable(NotesDbAdapter.KEY_ROWID);
if (mRowId == null) {
Bundle extras = getIntent().getExtras();
mRowId = extras != null ? extras.getLong(NotesDbAdapter.KEY_ROWID)
: null;
}
populateFields();
confirmButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
setResult(RESULT_OK);
finish();
}
});
}
private void populateFields() {
if (mRowId != null) {
Cursor note = mDbHelper.fetchNote(mRowId);
startManagingCursor(note);
mTitleText.setText(note.getString(
note.getColumnIndexOrThrow(NotesDbAdapter.KEY_TITLE)));
mBodyText.setText(note.getString(
note.getColumnIndexOrThrow(NotesDbAdapter.KEY_BODY)));
}
}
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
saveState();
outState.putSerializable(NotesDbAdapter.KEY_ROWID, mRowId);
}
@Override
protected void onPause() {
super.onPause();
saveState();
}
@Override
protected void onResume() {
super.onResume();
populateFields();
}
private void saveState() {
String title = mTitleText.getText().toString();
String body = mBodyText.getText().toString();
if (mRowId == null) {
long id = mDbHelper.createNote(title, body);
if (id > 0) {
mRowId = id;
}
} else {
mDbHelper.updateNote(mRowId, title, body);
}
}
}
|
3e0749625254da894bc6fae5a18d0885606caae9
| 1,415 |
java
|
Java
|
src/main/java/com/odakota/tms/system/base/BaseResponse.java
|
fossabot/tms-serve
|
c144a15d7b2df4f031178004b57e45ae3b2a0c1f
|
[
"MIT"
] | 1 |
2020-02-02T13:33:41.000Z
|
2020-02-02T13:33:41.000Z
|
src/main/java/com/odakota/tms/system/base/BaseResponse.java
|
fossabot/tms-serve
|
c144a15d7b2df4f031178004b57e45ae3b2a0c1f
|
[
"MIT"
] | null | null | null |
src/main/java/com/odakota/tms/system/base/BaseResponse.java
|
fossabot/tms-serve
|
c144a15d7b2df4f031178004b57e45ae3b2a0c1f
|
[
"MIT"
] | null | null | null | 24.824561 | 100 | 0.609187 | 3,086 |
package com.odakota.tms.system.base;
import lombok.Getter;
import org.springframework.data.domain.Page;
import java.util.List;
/**
* Resource list acquisition response
*
* @param <R> {@link BaseResource}
* @author haidv
* @version 1.0
*/
@Getter
public class BaseResponse<R extends BaseResource<?>> {
private Pagination pagination;
private List<R> data;
public BaseResponse(List<R> data) {
this.data = data;
}
public BaseResponse(Page<R> page) {
this.data = page.getContent();
this.pagination = new Pagination(page.getTotalPages(), page.getNumber() + 1, page.getSize(),
page.getTotalElements());
}
public BaseResponse(List<R> data, Page page) {
this.data = data;
this.pagination = new Pagination(page.getTotalPages(), page.getNumber() + 1, page.getSize(),
page.getTotalElements());
}
@Getter
private static class Pagination {
private long totalPage;
private long currentPage;
private long pageSize;
private long totalElement;
Pagination(long totalPage, long currentPage, long pageSize, long totalElement) {
this.totalPage = totalPage;
this.currentPage = currentPage;
this.pageSize = pageSize;
this.totalElement = totalElement;
}
}
}
|
3e0749750368af1650e6ace335fa32812f5afa7b
| 3,458 |
java
|
Java
|
Semester 3/Praktikum Pemprograman Dasar 2/pertemuan 7/Modul7/Modul7/src/modul7/Graph.java
|
bijancot/materikuliah
|
119c26238e08487dda9b0c4f700e393e581f59f8
|
[
"MIT"
] | null | null | null |
Semester 3/Praktikum Pemprograman Dasar 2/pertemuan 7/Modul7/Modul7/src/modul7/Graph.java
|
bijancot/materikuliah
|
119c26238e08487dda9b0c4f700e393e581f59f8
|
[
"MIT"
] | null | null | null |
Semester 3/Praktikum Pemprograman Dasar 2/pertemuan 7/Modul7/Modul7/src/modul7/Graph.java
|
bijancot/materikuliah
|
119c26238e08487dda9b0c4f700e393e581f59f8
|
[
"MIT"
] | null | null | null | 32.317757 | 98 | 0.539618 | 3,087 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modul7;
import java.util.ArrayList;
/**
*
* @author yohan
*/
public class Graph {
ArrayList<GraphNode> nodes;
ArrayList<GraphEdge> edges;
/* set this.nodes into new Arraylist<GraphNode>
set this.edges into new Arraylist<GraphEdge>
*/
public Graph() {
this.nodes = new ArrayList<GraphNode>();
this.edges = new ArrayList<GraphEdge>();
}
void add_node(GraphNode new_node) {
this.nodes.add(new_node);
}
void add_edge(GraphEdge new_edge) {
this.edges.add(new_edge);
}
void remove_node(GraphNode deleted_node) {
this.nodes.remove(deleted_node);
int i = 0;
while (i < this.edges.size()) {
GraphEdge edge = edges.get(i);
if (edge.src == deleted_node || edge.dst == deleted_node) {
this.edges.remove(edge);
} else {
i++;
}
}
}
void remove_edge(GraphEdge deleted_edge) {
this.edges.remove(deleted_edge);
}
ArrayList<GraphEdge> get_edges_by_source_node(GraphNode node) {
ArrayList<GraphEdge> node_edges = new ArrayList<GraphEdge>();
for (int i = 0; i < this.edges.size(); i++) {
GraphEdge edge = this.edges.get(i);
if (edge.src == node || edge.dst == node) {
node_edges.add(edge);
}
}
return node_edges;
}
GraphNode get_node_by_data(int data) {
for (int i = 0; i < this.nodes.size(); i++) {
GraphNode node = this.nodes.get(i);
if (node.data == data) {
return node;
}
}
return null;
}
Tree to_tree(int root_data) {
TreeNode first_tree_node = new TreeNode(root_data);
first_tree_node = this.completing_tree_node(first_tree_node);
Tree t = new Tree(first_tree_node);
return t;
}
TreeNode completing_tree_node(TreeNode tree_node) {
int data = tree_node.data;
GraphNode graph_node = this.get_node_by_data(data);
ArrayList<GraphEdge> edges = this.get_edges_by_source_node(graph_node);
for (int i = 0; i < edges.size(); i++) {
GraphEdge edge = edges.get(i);
if (edge.src == graph_node) {
int new_data = edge.dst.data;
boolean should_add_new_data = true;
TreeNode current_tree_node = tree_node;
while (current_tree_node != null) {
if (current_tree_node.data == new_data) {
should_add_new_data = false;
break;
}
current_tree_node = current_tree_node.parent;
}
if (should_add_new_data) {
TreeNode new_tree_node = new TreeNode(new_data);
tree_node.add_child(new_tree_node, edge.distance);
int last_index = tree_node.children.size() - 1;
tree_node.children.set(last_index, this.completing_tree_node(new_tree_node));
}
}
}
return tree_node;
}
}
|
3e074a179894c9c29c4b6daa20f6664b1786d48a
| 1,673 |
java
|
Java
|
src/main/java/com/gazi/Entity/Patient.java
|
mehmeterenballi/hospital-automation
|
30f58560110b3734d8c81d497b38836b15747900
|
[
"MIT"
] | null | null | null |
src/main/java/com/gazi/Entity/Patient.java
|
mehmeterenballi/hospital-automation
|
30f58560110b3734d8c81d497b38836b15747900
|
[
"MIT"
] | null | null | null |
src/main/java/com/gazi/Entity/Patient.java
|
mehmeterenballi/hospital-automation
|
30f58560110b3734d8c81d497b38836b15747900
|
[
"MIT"
] | null | null | null | 18.184783 | 79 | 0.561267 | 3,088 |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.gazi.Entity;
import javax.persistence.*;
/**
*
* @author fakdi
*/
@Entity
@Table(name="patients")
public class Patient {
@Id
@Column(name="id")
private int id;
@Column(name="tcNo")
private String tcNo;
@Column(name="firstName")
private String firstName;
@Column(name="lastName")
private String lastName;
public Patient(String tcNo,String firstName,String lastName){
this.firstName = firstName;
this.lastName = lastName;
this.tcNo = tcNo;
}
/**
* @return the id
*/
public int getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(int id) {
this.id = id;
}
/**
* @return the tcNo
*/
public String getTcNo() {
return tcNo;
}
/**
* @param tcNo the tcNo to set
*/
public void setTcNo(String tcNo) {
this.tcNo = tcNo;
}
/**
* @return the firstName
*/
public String getFirstName() {
return firstName;
}
/**
* @param firstName the firstName to set
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* @return the lastName
*/
public String getLastName() {
return lastName;
}
/**
* @param lastName the lastName to set
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
|
3e074a1fb5b0c5e05f0e1b848690ec8f6f99f15a
| 223 |
java
|
Java
|
src/main/java/com/pedrohrr/simpletransfer/SimpleTransferApplication.java
|
pedrohrr/blade-simple-transfer
|
d0afded6ae1feecf65de247e35cd535d9bdf8e70
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/pedrohrr/simpletransfer/SimpleTransferApplication.java
|
pedrohrr/blade-simple-transfer
|
d0afded6ae1feecf65de247e35cd535d9bdf8e70
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/com/pedrohrr/simpletransfer/SimpleTransferApplication.java
|
pedrohrr/blade-simple-transfer
|
d0afded6ae1feecf65de247e35cd535d9bdf8e70
|
[
"Apache-2.0"
] | null | null | null | 20.272727 | 64 | 0.730942 | 3,089 |
package com.pedrohrr.simpletransfer;
import com.blade.Blade;
public class SimpleTransferApplication {
public static void main(String[] args) {
Blade.of().start(SimpleTransferApplication.class, args);
}
}
|
3e074a295541c9222b672b3bed3a81795c89619e
| 903 |
java
|
Java
|
src/main/java/com/codestian/homeassistantmc/init/ModItems.java
|
Codestian/homeassistantmc
|
04ab5ff6e19f47f7abc1adb6a89f8c1a4bc896d8
|
[
"MIT"
] | 24 |
2021-07-08T12:56:22.000Z
|
2022-03-27T13:39:30.000Z
|
src/main/java/com/codestian/homeassistantmc/init/ModItems.java
|
Codestian/homeassistantmc
|
04ab5ff6e19f47f7abc1adb6a89f8c1a4bc896d8
|
[
"MIT"
] | 1 |
2021-09-28T22:26:03.000Z
|
2021-09-29T20:07:24.000Z
|
src/main/java/com/codestian/homeassistantmc/init/ModItems.java
|
Codestian/homeassistantmc
|
04ab5ff6e19f47f7abc1adb6a89f8c1a4bc896d8
|
[
"MIT"
] | 1 |
2021-07-18T10:56:20.000Z
|
2021-07-18T10:56:20.000Z
| 45.15 | 195 | 0.807309 | 3,090 |
package com.codestian.homeassistantmc.init;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import static com.codestian.homeassistantmc.HomeAssistantMC.MOD_ID;
public class ModItems {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID);
public static final RegistryObject<Item> STATE_BLOCK = ITEMS.register("state_block", () -> new BlockItem(ModBlocks.STATE_BLOCK.get(), new Item.Properties().tab(ItemGroup.TAB_REDSTONE)));
public static final RegistryObject<Item> SERVICE_BLOCK = ITEMS.register("service_block", () -> new BlockItem(ModBlocks.SERVCE_BLOCK.get(), new Item.Properties().tab(ItemGroup.TAB_REDSTONE)));
}
|
3e074c216352d9c77667c8a7ae96a116cdf92efc
| 497 |
java
|
Java
|
example/flutter_app/android/app/src/main/kotlin/com/siyehua/spiexample1/channel/native2flutter/Fps2.java
|
siyehua/spi_flutter_package
|
412026c2c170c5c237341100b13b5a9601fcfea5
|
[
"BSD-3-Clause"
] | 3 |
2021-04-20T07:04:42.000Z
|
2021-09-16T14:26:22.000Z
|
example/flutter_app/android/app/src/main/kotlin/com/siyehua/spiexample1/channel/native2flutter/Fps2.java
|
siyehua/spi_flutter_package
|
412026c2c170c5c237341100b13b5a9601fcfea5
|
[
"BSD-3-Clause"
] | null | null | null |
example/flutter_app/android/app/src/main/kotlin/com/siyehua/spiexample1/channel/native2flutter/Fps2.java
|
siyehua/spi_flutter_package
|
412026c2c170c5c237341100b13b5a9601fcfea5
|
[
"BSD-3-Clause"
] | 3 |
2021-07-22T07:33:32.000Z
|
2021-11-22T04:43:48.000Z
| 41.416667 | 110 | 0.782696 | 3,091 |
package com.siyehua.spiexample1.channel.native2flutter;
import java.util.ArrayList;
import java.util.HashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.siyehua.spiexample1.channel.ChannelManager.Result;
public class Fps2 {
void getPageName( @NotNull HashMap<String, Long> t, @NotNull String t2, @NotNull Result<String> callback);
void getFps( @NotNull String t, @NotNull Long a, @NotNull Result<Double> callback);
void add23();
}
|
3e074d76085b6b427167c305c70056380611c623
| 3,259 |
java
|
Java
|
aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/transform/DefaultClusterParametersStaxUnmarshaller.java
|
jplippi/aws-sdk-java
|
147eefec220e2944dc571283af6552611bc94301
|
[
"Apache-2.0"
] | 1 |
2020-08-27T17:36:34.000Z
|
2020-08-27T17:36:34.000Z
|
aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/transform/DefaultClusterParametersStaxUnmarshaller.java
|
jplippi/aws-sdk-java
|
147eefec220e2944dc571283af6552611bc94301
|
[
"Apache-2.0"
] | 3 |
2020-04-15T20:08:15.000Z
|
2021-06-30T19:58:16.000Z
|
aws-java-sdk-redshift/src/main/java/com/amazonaws/services/redshift/model/transform/DefaultClusterParametersStaxUnmarshaller.java
|
jplippi/aws-sdk-java
|
147eefec220e2944dc571283af6552611bc94301
|
[
"Apache-2.0"
] | 1 |
2020-10-10T15:59:17.000Z
|
2020-10-10T15:59:17.000Z
| 38.797619 | 130 | 0.675361 | 3,092 |
/*
* Copyright 2015-2020 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.redshift.model.transform;
import java.util.ArrayList;
import javax.xml.stream.events.XMLEvent;
import javax.annotation.Generated;
import com.amazonaws.services.redshift.model.*;
import com.amazonaws.transform.Unmarshaller;
import com.amazonaws.transform.StaxUnmarshallerContext;
import com.amazonaws.transform.SimpleTypeStaxUnmarshallers.*;
/**
* DefaultClusterParameters StAX Unmarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DefaultClusterParametersStaxUnmarshaller implements Unmarshaller<DefaultClusterParameters, StaxUnmarshallerContext> {
public DefaultClusterParameters unmarshall(StaxUnmarshallerContext context) throws Exception {
DefaultClusterParameters defaultClusterParameters = new DefaultClusterParameters();
int originalDepth = context.getCurrentDepth();
int targetDepth = originalDepth + 1;
if (context.isStartOfDocument())
targetDepth += 3;
while (true) {
XMLEvent xmlEvent = context.nextEvent();
if (xmlEvent.isEndDocument())
return defaultClusterParameters;
if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {
if (context.testExpression("ParameterGroupFamily", targetDepth)) {
defaultClusterParameters.setParameterGroupFamily(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("Marker", targetDepth)) {
defaultClusterParameters.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
if (context.testExpression("Parameters", targetDepth)) {
defaultClusterParameters.withParameters(new ArrayList<Parameter>());
continue;
}
if (context.testExpression("Parameters/Parameter", targetDepth)) {
defaultClusterParameters.withParameters(ParameterStaxUnmarshaller.getInstance().unmarshall(context));
continue;
}
} else if (xmlEvent.isEndElement()) {
if (context.getCurrentDepth() < originalDepth) {
return defaultClusterParameters;
}
}
}
}
private static DefaultClusterParametersStaxUnmarshaller instance;
public static DefaultClusterParametersStaxUnmarshaller getInstance() {
if (instance == null)
instance = new DefaultClusterParametersStaxUnmarshaller();
return instance;
}
}
|
3e074d7b741c8244c47df13b326195dfb5e8a2be
| 5,576 |
java
|
Java
|
src/main/java/io/sigpipe/jbsdiff/ui/CLI.java
|
malensek/jbsdiff
|
51b6981d97b4cf386069481707394f37c537b1d5
|
[
"BSD-2-Clause"
] | 112 |
2015-03-13T10:05:37.000Z
|
2022-03-11T09:22:14.000Z
|
src/main/java/io/sigpipe/jbsdiff/ui/CLI.java
|
malensek/jbsdiff
|
51b6981d97b4cf386069481707394f37c537b1d5
|
[
"BSD-2-Clause"
] | 12 |
2015-05-31T17:43:40.000Z
|
2020-03-24T02:53:44.000Z
|
src/main/java/io/sigpipe/jbsdiff/ui/CLI.java
|
malensek/jbsdiff
|
51b6981d97b4cf386069481707394f37c537b1d5
|
[
"BSD-2-Clause"
] | 46 |
2015-01-06T09:32:27.000Z
|
2021-09-25T08:28:06.000Z
| 39.267606 | 92 | 0.618723 | 3,093 |
/*
Copyright (c) 2013, Colorado State University
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
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.
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 the copyright holder 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 io.sigpipe.jbsdiff.ui;
import java.io.File;
/**
* Provides a simple command line interface for the io.sigpipe.jbsdiff tools.
*
* @author malensek
*/
public class CLI {
private static final String COMMAND_DIFF = "diff";
private static final String COMMAND_PATCH = "patch";
private CLI() { }
/** Diff or patch with specified files.
* Format is command oldFile newFile patchFile .
* Command is either diff or patch */
public static void main(String[] args) throws Exception {
if ( args.length == 3 ) {
args = withCommandGuess( args );
}
if (args.length < 4) {
System.out.println("Not enough parameters!");
printUsage();
}
String compression = System.getProperty("jbsdiff.compressor", "bzip2");
compression = compression.toLowerCase();
try {
String command = args[0].toLowerCase();
File oldFile = new File(args[1]);
File newFile = new File(args[2]);
File patchFile = new File(args[3]);
if (COMMAND_DIFF.equals(command)) {
FileUI.diff(oldFile, newFile, patchFile, compression);
} else if (COMMAND_PATCH.equals(command)) {
FileUI.patch(oldFile, newFile, patchFile);
} else {
printUsage();
}
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
/** Shows the expected arguments for jbsdiff, with compression schemes. */
public static void printUsage() {
String usage = String.format("" +
"Usage: command <oldfile> <newfile> <patchfile>%n%n" +
"Commands:%n" +
" diff%n" +
" patch%n%n" +
"Use the jbsdiff.compressor property to select a different " +
"compression scheme:%n" +
" java -Djbsdiff.compressor=gz -jar jbsdiff-*.jar diff " +
"a.bin b.bin patch.gz%n%n" +
"Supported compression schemes: bzip2 (default), gz, pack200, xz.%n%n" +
"The compression algorithm used will be detected automatically during %n" +
"patch operations. NOTE: algorithms other than bzip2 are incompatible %n" +
"with the reference implementation of bsdiff!");
System.out.println(usage);
System.exit(1);
}
/** Attempts to fill in a forgotten command based on which file doesn't exist. */
private static String[] withCommandGuess(String[] args) {
if ( args.length != 3 ) {
// caller provided too few to operate or enough arguments to avoid guessing
return args;
}
if (COMMAND_DIFF.equals(args[0]) || COMMAND_PATCH.equals(args[0])) {
// caller actually forgot a file, rather than the command
return args;
}
File oldFile = new File(args[0]);
File newFile = new File(args[1]);
File patchFile = new File(args[2]);
String chosenAction, command;
String actionTemplate = "Guessing! %s %s & %s AS %s";
if (oldFile.exists() && newFile.exists()
&& ! patchFile.exists()) {
command = COMMAND_DIFF;
chosenAction = String.format(actionTemplate,
command, oldFile, newFile, patchFile);
System.out.println(chosenAction);
args = insertCommand(command, args);
} else if (oldFile.exists() && patchFile.exists()
&& ! newFile.exists()) {
command = COMMAND_PATCH;
chosenAction = String.format(actionTemplate,
command, oldFile, patchFile, newFile);
System.out.println(chosenAction);
args = insertCommand(command, args);
}
return args;
}
/** Prefixes an array with the desired command */
private static String[] insertCommand(String command, String[] args) {
String[] withCommand = new String[args.length +1];
withCommand[0] = command;
for (int i = 0; i < args.length; i++) {
withCommand[i +1] = args[i];
}
return withCommand;
}
}
|
3e074dcde8ced8ccbbbdbd6b4c0c60a235f0f6da
| 10,504 |
java
|
Java
|
metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
|
jaidrao/ApacheMetron
|
63209e7e30b3b8089850c1e010fa8e126cdf1562
|
[
"Apache-2.0"
] | null | null | null |
metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
|
jaidrao/ApacheMetron
|
63209e7e30b3b8089850c1e010fa8e126cdf1562
|
[
"Apache-2.0"
] | null | null | null |
metron-platform/metron-common/src/main/java/org/apache/metron/common/query/QueryCompiler.java
|
jaidrao/ApacheMetron
|
63209e7e30b3b8089850c1e010fa8e126cdf1562
|
[
"Apache-2.0"
] | null | null | null | 31.449102 | 134 | 0.657749 | 3,094 |
/**
* 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.metron.common.query;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
import org.apache.metron.common.dsl.*;
import org.apache.metron.common.query.generated.PredicateBaseListener;
import org.apache.metron.common.query.generated.PredicateParser;
import java.util.*;
import java.util.function.Function;
import java.util.function.Predicate;
class QueryCompiler extends PredicateBaseListener {
private VariableResolver resolver = null;
private Stack<Token> tokenStack = new Stack<>();
public QueryCompiler(VariableResolver resolver) {
this.resolver = resolver;
}
@Override
public void enterSingle_rule(org.apache.metron.common.query.generated.PredicateParser.Single_ruleContext ctx) {
tokenStack.clear();
}
@Override
public void exitSingle_rule(org.apache.metron.common.query.generated.PredicateParser.Single_ruleContext ctx) {
}
@Override
public void exitLogicalExpressionAnd(PredicateParser.LogicalExpressionAndContext ctx) {
Token<?> left = popStack();
Token<?> right = popStack();
tokenStack.push(new Token<>(booleanOp(left, right, (l, r) -> l && r, "&&"), Boolean.class));
}
@Override
public void exitLogicalExpressionOr(PredicateParser.LogicalExpressionOrContext ctx) {
Token<?> left = popStack();
Token<?> right = popStack();
tokenStack.push(new Token<>(booleanOp(left, right, (l, r) -> l || r, "||"), Boolean.class));
}
private boolean booleanOp(Token<?> left, Token<?> right, BooleanOp op, String opName)
{
if(left.getUnderlyingType().equals(right.getUnderlyingType()) && left.getUnderlyingType().equals(Boolean.class)) {
Boolean l = (Boolean) left.getValue();
Boolean r = (Boolean) right.getValue();
if(l == null || r == null) {
throw new ParseException("Unable to operate on " + left.getValue() + " " + opName + " " + right.getValue() + ", null value");
}
return op.op(l, r);
}
else {
throw new ParseException("Unable to operate on " + left.getValue() + " " + opName + " " + right.getValue() + ", bad types");
}
}
@Override
public void exitLogicalConst(PredicateParser.LogicalConstContext ctx) {
Boolean b = null;
switch(ctx.getText().toUpperCase()) {
case "TRUE":
b = true;
break;
case "FALSE":
b = false;
break;
default:
throw new ParseException("Unable to process " + ctx.getText() + " as a boolean constant");
}
tokenStack.push(new Token<>(b, Boolean.class));
}
@Override
public void exitDoubleLiteral(PredicateParser.DoubleLiteralContext ctx) {
tokenStack.push(new Token<>(Double.parseDouble(ctx.getText()), Double.class));
}
@Override
public void exitIntegerLiteral(PredicateParser.IntegerLiteralContext ctx) {
tokenStack.push(new Token<>(Integer.parseInt(ctx.getText()), Integer.class));
}
private <T extends Comparable<T>> boolean compare(T l, T r, String op) {
if(op.equals("==")) {
return l.compareTo(r) == 0;
}
else if(op.equals("!=")) {
return l.compareTo(r) != 0;
}
else if(op.equals("<")) {
return l.compareTo(r) < 0;
}
else if(op.equals(">")) {
return l.compareTo(r) > 0;
}
else if(op.equals(">=")) {
return l.compareTo(r) >= 0;
}
else {
return l.compareTo(r) <= 0;
}
}
@Override
public void exitComparisonExpressionWithOperator(PredicateParser.ComparisonExpressionWithOperatorContext ctx) {
String op = ctx.getChild(1).getText();
Token<?> right = popStack();
Token<?> left = popStack();
if(left.getValue() instanceof Number
&& right.getValue() instanceof Number
) {
Double l = ((Number)left.getValue()).doubleValue();
Double r = ((Number)right.getValue()).doubleValue();
tokenStack.push(new Token<>(compare(l, r, op), Boolean.class));
}
else {
String l = left.getValue() == null?"":left.getValue().toString();
String r = right.getValue() == null?"":right.getValue().toString();
tokenStack.push(new Token<>(compare(l, r, op), Boolean.class));
}
}
public Token<?> popStack() {
if(tokenStack.empty()) {
throw new ParseException("Unable to pop an empty stack");
}
return tokenStack.pop();
}
@Override
public void exitLogicalVariable(PredicateParser.LogicalVariableContext ctx) {
tokenStack.push(new Token<>(resolver.resolve(ctx.getText()), Object.class));
}
@Override
public void exitStringLiteral(PredicateParser.StringLiteralContext ctx) {
String val = ctx.getText();
tokenStack.push(new Token<>(val.substring(1, val.length() - 1), String.class));
}
@Override
public void enterList_entity(PredicateParser.List_entityContext ctx) {
tokenStack.push(new Token<>(new FunctionMarker(), FunctionMarker.class));
}
@Override
public void exitList_entity(PredicateParser.List_entityContext ctx) {
LinkedList<String> args = new LinkedList<>();
while(true) {
Token<?> token = popStack();
if(token.getUnderlyingType().equals(FunctionMarker.class)) {
break;
}
else {
args.addFirst((String)token.getValue());
}
}
tokenStack.push(new Token<>(args, List.class));
}
@Override
public void enterFunc_args(PredicateParser.Func_argsContext ctx) {
tokenStack.push(new Token<>(new FunctionMarker(), FunctionMarker.class));
}
@Override
public void exitFunc_args(PredicateParser.Func_argsContext ctx) {
LinkedList<Object> args = new LinkedList<>();
while(true) {
Token<?> token = popStack();
if(token.getUnderlyingType().equals(FunctionMarker.class)) {
break;
}
else {
args.addFirst(token.getValue());
}
}
tokenStack.push(new Token<>(args, List.class));
}
private boolean handleIn(Token<?> left, Token<?> right) {
Object key = null;
Set<Object> set = null;
if(left.getValue() instanceof Collection) {
set = new HashSet<>((List<Object>) left.getValue());
}
else if(left.getValue() != null) {
set = ImmutableSet.of(left.getValue());
}
else {
set = new HashSet<>();
}
key = right.getValue();
if(key == null || set.isEmpty()) {
return false;
}
return set.contains(key);
}
@Override
public void exitInExpression(PredicateParser.InExpressionContext ctx) {
Token<?> left = popStack();
Token<?> right = popStack();
tokenStack.push(new Token<>(handleIn(left, right), Boolean.class));
}
@Override
public void exitNInExpression(PredicateParser.NInExpressionContext ctx) {
Token<?> left = popStack();
Token<?> right = popStack();
tokenStack.push(new Token<>(!handleIn(left, right), Boolean.class));
}
@Override
public void exitLogicalFunc(PredicateParser.LogicalFuncContext ctx) {
String funcName = ctx.getChild(0).getText();
Predicate<List<Object>> func;
try {
func = LogicalFunctions.valueOf(funcName);
}
catch(IllegalArgumentException iae) {
throw new ParseException("Unable to find logical function " + funcName + ". Valid functions are "
+ Joiner.on(',').join(LogicalFunctions.values())
);
}
Token<?> left = popStack();
List<Object> argList = null;
if(left.getValue() instanceof List) {
argList = (List<Object>) left.getValue();
}
else {
throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
}
Boolean result = func.test(argList);
tokenStack.push(new Token<>(result, Boolean.class));
}
/**
* {@inheritDoc}
* <p/>
* <p>The default implementation does nothing.</p>
*
* @param ctx
*/
@Override
public void exitTransformationFunc(PredicateParser.TransformationFuncContext ctx) {
String funcName = ctx.getChild(0).getText();
Function<List<Object>, Object> func;
try {
func = TransformationFunctions.valueOf(funcName);
}
catch(IllegalArgumentException iae) {
throw new ParseException("Unable to find string function " + funcName + ". Valid functions are "
+ Joiner.on(',').join(TransformationFunctions.values())
);
}
Token<?> left = popStack();
List<Object> argList = null;
if(left.getUnderlyingType().equals(List.class)) {
argList = (List<Object>) left.getValue();
}
else {
throw new ParseException("Unable to process in clause because " + left.getValue() + " is not a set");
}
Object result = func.apply(argList);
tokenStack.push(new Token<>(result, Object.class));
}
@Override
public void exitExistsFunc(PredicateParser.ExistsFuncContext ctx) {
String variable = ctx.getChild(2).getText();
boolean exists = resolver.resolve(variable) != null;
tokenStack.push(new Token<>(exists, Boolean.class));
}
@Override
public void exitNotFunc(PredicateParser.NotFuncContext ctx) {
Token<Boolean> arg = (Token<Boolean>) popStack();
tokenStack.push(new Token<>(!arg.getValue(), Boolean.class));
}
public boolean getResult() throws ParseException {
if(tokenStack.empty()) {
throw new ParseException("Invalid predicate: Empty stack.");
}
Token<?> token = popStack();
if(token.getUnderlyingType().equals(Boolean.class) && tokenStack.empty()) {
return (Boolean)token.getValue();
}
if(tokenStack.empty()) {
throw new ParseException("Invalid parse, stack not empty: " + Joiner.on(',').join(tokenStack));
}
else {
throw new ParseException("Invalid parse, found " + token + " but expected boolean");
}
}
}
|
3e074e5fcd34b6d470c298b4ff6c20313baa374e
| 2,089 |
java
|
Java
|
src/main/java/net/odyssi/asc4j/model/UsersResponse.java
|
TheGeekPharaoh/asc4j
|
63011e13dca11fa4cd8c26f0484fb92887345ab7
|
[
"Apache-2.0"
] | 6 |
2020-08-18T04:34:32.000Z
|
2022-03-10T09:41:38.000Z
|
src/main/java/net/odyssi/asc4j/model/UsersResponse.java
|
TheGeekPharaoh/asc4j
|
63011e13dca11fa4cd8c26f0484fb92887345ab7
|
[
"Apache-2.0"
] | 1 |
2020-08-18T04:38:50.000Z
|
2020-08-18T18:33:08.000Z
|
src/main/java/net/odyssi/asc4j/model/UsersResponse.java
|
TheGeekPharaoh/asc4j
|
63011e13dca11fa4cd8c26f0484fb92887345ab7
|
[
"Apache-2.0"
] | 6 |
2021-05-19T10:17:30.000Z
|
2022-03-23T00:15:00.000Z
| 20.086538 | 83 | 0.663954 | 3,095 |
package net.odyssi.asc4j.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* A response containing a list of resources.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
})
public class UsersResponse extends BaseServiceResponse {
@JsonProperty("data")
@JsonPropertyDescription("")
private List<User> data;
@JsonProperty("included")
@JsonPropertyDescription("")
private List<App> included;
/*
* (non-Javadoc)
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
UsersResponse other = (UsersResponse) obj;
if (this.data == null) {
if (other.data != null) {
return false;
}
} else if (!this.data.equals(other.data)) {
return false;
}
if (this.included == null) {
if (other.included != null) {
return false;
}
} else if (!this.included.equals(other.included)) {
return false;
}
return true;
}
public List<User> getData() {
return this.data;
}
public List<App> getIncluded() {
return this.included;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + (this.data == null ? 0 : this.data.hashCode());
result = prime * result + (this.included == null ? 0 : this.included.hashCode());
return result;
}
public void setData(List<User> data) {
this.data = data;
}
public void setIncluded(List<App> included) {
this.included = included;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return "UsersResponse [data=" + this.data + ", included=" + this.included + "]";
}
}
|
3e074e91c1add7101bd387c244939251817e3d29
| 3,983 |
java
|
Java
|
src/main/java/com/microsoft/jenkins/artifactmanager/AzureArtifactConfig.java
|
timja/azure-artifact-manager-plugin
|
d198eef0cef253e397db7993f6ce2be903d13ad8
|
[
"MIT"
] | 1 |
2020-06-23T17:26:49.000Z
|
2020-06-23T17:26:49.000Z
|
src/main/java/com/microsoft/jenkins/artifactmanager/AzureArtifactConfig.java
|
jglick/azure-artifact-manager-plugin
|
b3d6375f19568213229c7b12116a42cdeb4a85d6
|
[
"MIT"
] | null | null | null |
src/main/java/com/microsoft/jenkins/artifactmanager/AzureArtifactConfig.java
|
jglick/azure-artifact-manager-plugin
|
b3d6375f19568213229c7b12116a42cdeb4a85d6
|
[
"MIT"
] | null | null | null | 31.864 | 108 | 0.685915 | 3,096 |
/*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/
package com.microsoft.jenkins.artifactmanager;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.StandardListBoxModel;
import com.microsoftopentechnologies.windowsazurestorage.helper.AzureStorageAccount;
import hudson.Extension;
import hudson.ExtensionList;
import hudson.ExtensionPoint;
import hudson.model.Describable;
import hudson.model.Descriptor;
import hudson.model.Item;
import hudson.security.ACL;
import hudson.util.FormValidation;
import hudson.util.ListBoxModel;
import jenkins.model.Jenkins;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import java.io.Serializable;
import java.util.Collections;
@Extension
public class AzureArtifactConfig implements ExtensionPoint, Serializable, Describable<AzureArtifactConfig> {
private static final long serialVersionUID = -3283542207832596121L;
private String storageCredentialId;
private String container;
private String prefix;
public AzureArtifactConfig() {
}
@DataBoundConstructor
public AzureArtifactConfig(String storageCredentialId) {
this.storageCredentialId = storageCredentialId;
}
public String getContainer() {
return container;
}
@DataBoundSetter
public void setContainer(String container) {
this.container = container;
}
public String getPrefix() {
return prefix;
}
@DataBoundSetter
public void setPrefix(String prefix) {
this.prefix = prefix;
}
public String getStorageCredentialId() {
return this.storageCredentialId;
}
public static AzureArtifactConfig get() {
return ExtensionList.lookupSingleton(AzureArtifactConfig.class);
}
@Override
public Descriptor<AzureArtifactConfig> getDescriptor() {
Jenkins instance = Jenkins.getInstanceOrNull();
if (instance == null) {
return null;
}
return instance.getDescriptor(getClass());
}
@Extension
public static final class DescriptorImpl extends Descriptor<AzureArtifactConfig> {
public DescriptorImpl() {
load();
}
@Override
public boolean configure(StaplerRequest req, JSONObject json) throws FormException {
save();
return super.configure(req, json);
}
@Override
public String getDisplayName() {
return Constants.AZURE_STORAGE_DISPLAY_NAME;
}
public ListBoxModel doFillStorageCredentialIdItems(@AncestorInPath Item owner) {
ListBoxModel m = new StandardListBoxModel().withAll(
CredentialsProvider.lookupCredentials(
AzureStorageAccount.class,
owner,
ACL.SYSTEM,
Collections.emptyList()));
return m;
}
public FormValidation doCheckContainer(@QueryParameter String container) {
boolean isValid = Utils.containTokens(container) || Utils.validateContainerName(container);
if (!isValid) {
return FormValidation.error(Messages.AzureArtifactConfig_invalid_container_name(container));
}
return FormValidation.ok();
}
public FormValidation doCheckPrefix(@QueryParameter String prefix) {
boolean isValid = Utils.isPrefixValid(prefix);
if (!isValid) {
return FormValidation.error(Messages.AzureArtifactConfig_invalid_prefix(prefix));
}
return FormValidation.ok();
}
}
}
|
3e074e93b745259a02d5fe9e31562e5759efa065
| 4,408 |
java
|
Java
|
Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java
|
JayDi85/mage
|
bfb9fd9635b74ad67dbab5d608c7eca5601018f0
|
[
"MIT"
] | null | null | null |
Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java
|
JayDi85/mage
|
bfb9fd9635b74ad67dbab5d608c7eca5601018f0
|
[
"MIT"
] | null | null | null |
Mage.Sets/src/mage/cards/c/CryOfTheCarnarium.java
|
JayDi85/mage
|
bfb9fd9635b74ad67dbab5d608c7eca5601018f0
|
[
"MIT"
] | null | null | null | 34.708661 | 201 | 0.686025 | 3,097 |
package mage.cards.c;
import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.watchers.common.CardsPutIntoGraveyardWatcher;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class CryOfTheCarnarium extends CardImpl {
public CryOfTheCarnarium(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
// All creatures get -2/-2 until end of turn. Exile all creature cards in all graveyards that were put there from the battlefield this turn. If a creature would die this turn, exile it instead.
this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn));
this.getSpellAbility().addEffect(new CryOfTheCarnariumExileEffect());
this.getSpellAbility().addEffect(new CryOfTheCarnariumReplacementEffect());
this.getSpellAbility().addWatcher(new CardsPutIntoGraveyardWatcher());
}
private CryOfTheCarnarium(final CryOfTheCarnarium card) {
super(card);
}
@Override
public CryOfTheCarnarium copy() {
return new CryOfTheCarnarium(this);
}
}
class CryOfTheCarnariumExileEffect extends OneShotEffect {
CryOfTheCarnariumExileEffect() {
super(Outcome.Benefit);
staticText = "Exile all creature cards in all graveyards that were put there from the battlefield this turn.";
}
private CryOfTheCarnariumExileEffect(final CryOfTheCarnariumExileEffect effect) {
super(effect);
}
@Override
public CryOfTheCarnariumExileEffect copy() {
return new CryOfTheCarnariumExileEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
CardsPutIntoGraveyardWatcher watcher = game.getState().getWatcher(CardsPutIntoGraveyardWatcher.class);
if (player == null || watcher == null) {
return false;
}
Cards cards = new CardsImpl();
for (MageObjectReference mor : watcher.getCardsPutToGraveyardFromBattlefield()) {
if (game.getState().getZoneChangeCounter(mor.getSourceId()) == mor.getZoneChangeCounter()) {
Card card = mor.getCard(game);
if (card != null && card.isCreature()) {
cards.add(card);
}
}
}
player.moveCards(cards, Zone.EXILED, source, game);
return true;
}
}
class CryOfTheCarnariumReplacementEffect extends ReplacementEffectImpl {
CryOfTheCarnariumReplacementEffect() {
super(Duration.EndOfTurn, Outcome.Exile);
staticText = "If a creature would die this turn, exile it instead.";
}
private CryOfTheCarnariumReplacementEffect(final CryOfTheCarnariumReplacementEffect effect) {
super(effect);
}
@Override
public CryOfTheCarnariumReplacementEffect copy() {
return new CryOfTheCarnariumReplacementEffect(this);
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
Permanent permanent = ((ZoneChangeEvent) event).getTarget();
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player == null) {
return player.moveCards(permanent, Zone.EXILED, source, game);
}
}
return false;
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getTarget() != null
&& zEvent.getTarget().isCreature()
&& zEvent.getFromZone() == Zone.BATTLEFIELD
&& zEvent.getToZone() == Zone.GRAVEYARD;
}
}
|
3e074f5be8fb82e21028bcf7aaa9f29f970edd8b
| 1,327 |
java
|
Java
|
src/main/java/io/github/yutoeguma/dbflute/cbean/ProjectCB.java
|
EgumaYuto/taskticket
|
3dff5647f18cb07310bf8b9f95eb8c5ffaecb1e3
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/io/github/yutoeguma/dbflute/cbean/ProjectCB.java
|
EgumaYuto/taskticket
|
3dff5647f18cb07310bf8b9f95eb8c5ffaecb1e3
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/io/github/yutoeguma/dbflute/cbean/ProjectCB.java
|
EgumaYuto/taskticket
|
3dff5647f18cb07310bf8b9f95eb8c5ffaecb1e3
|
[
"Apache-2.0"
] | null | null | null | 33.175 | 71 | 0.698568 | 3,098 |
/*
* Copyright 2015-2017 the original author or authors.
*
* 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 io.github.yutoeguma.dbflute.cbean;
import io.github.yutoeguma.dbflute.cbean.bs.BsProjectCB;
/**
* The condition-bean of PROJECT.
* <p>
* You can implement your original methods here.
* This class remains when re-generating.
* </p>
* @author DBFlute(AutoGenerator)
*/
public class ProjectCB extends BsProjectCB {
public void arrangeApprovalProject(Long memberId) {
orScopeQuery(orCB -> {
orCB.query().setMemberId_Equal(memberId);
orCB.query().existsProjectMember(projectMemberCB -> {
projectMemberCB.query().setMemberId_Equal(memberId);
projectMemberCB.query().setDelFlg_Equal_False();
});
});
}
}
|
3e075146e787075c364e66e1d5406f5b10954836
| 834 |
java
|
Java
|
asonretrofit/src/test/java/com/afollestad/asonretrofit/TestService.java
|
afollestad/ason
|
183926f08dc56bddc9b85be2cddc02a481837411
|
[
"Apache-2.0"
] | 871 |
2017-02-04T22:08:45.000Z
|
2021-11-08T10:06:35.000Z
|
asonretrofit/src/test/java/com/afollestad/asonretrofit/TestService.java
|
aruntom/ason
|
183926f08dc56bddc9b85be2cddc02a481837411
|
[
"Apache-2.0"
] | 23 |
2017-02-04T22:28:37.000Z
|
2018-04-11T10:56:31.000Z
|
asonretrofit/src/test/java/com/afollestad/asonretrofit/TestService.java
|
aruntom/ason
|
183926f08dc56bddc9b85be2cddc02a481837411
|
[
"Apache-2.0"
] | 87 |
2017-02-06T03:11:26.000Z
|
2020-07-21T12:07:56.000Z
| 27.8 | 77 | 0.758993 | 3,099 |
package com.afollestad.asonretrofit;
import io.reactivex.Single;
import java.util.List;
import retrofit2.Response;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.PUT;
public interface TestService {
@GET("/afollestad/ason/master/asonretrofit/test.json")
Single<Response<TestData>> getTestObject();
@GET("/afollestad/ason/master/asonretrofit/test2.json")
Single<Response<List<TestPerson>>> getTestList();
@GET("/afollestad/ason/master/asonretrofit/test2.json")
Single<Response<TestPerson[]>> getTestArray();
@PUT("/put")
Single<Response<EchoObjectWrapper>> putTestObject(@Body TestData object);
@PUT("/put")
Single<Response<EchoArrayWrapper>> putTestArray(@Body TestPerson[] array);
@PUT("/put")
Single<Response<EchoListWrapper>> putTestList(@Body List<TestPerson> list);
}
|
3e07514824074ace532e604a5f589babd7387cc1
| 4,701 |
java
|
Java
|
src/main/java/frc/robot/Climber.java
|
CodeRed2771/2021Robot
|
e89559fd67d164092c3cef4d5d2b18efaa66dc63
|
[
"BSD-3-Clause"
] | null | null | null |
src/main/java/frc/robot/Climber.java
|
CodeRed2771/2021Robot
|
e89559fd67d164092c3cef4d5d2b18efaa66dc63
|
[
"BSD-3-Clause"
] | null | null | null |
src/main/java/frc/robot/Climber.java
|
CodeRed2771/2021Robot
|
e89559fd67d164092c3cef4d5d2b18efaa66dc63
|
[
"BSD-3-Clause"
] | null | null | null | 35.613636 | 133 | 0.714954 | 3,100 |
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot;
import com.revrobotics.CANSparkMax;
import com.revrobotics.ControlType;
import com.revrobotics.CANSparkMax.IdleMode;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
import edu.wpi.first.wpilibj.BuiltInAccelerometer;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
public class Climber {
private static boolean dropBellyPan = false;
private static boolean pickUpBellyPan = false;
private static Climber instance;
private static BuiltInAccelerometer accelerometer = new BuiltInAccelerometer();
private static CANSparkMax extenderMotor = new CANSparkMax(Wiring.EXTEND_MOTOR_ID, MotorType.kBrushless);
private static CANSparkMax liftMotor = new CANSparkMax(Wiring.LIFT_MOTOR_ID, MotorType.kBrushless);
public static final double BASE_EXTENDED_POSITION = 350; // tune for actual max extension revolutions
public static final double MAX_EXTENDED_POSITION = 400; // needs adjusting
public static boolean isLifting = false;
public static double liftPositionWhenLiftingStarted = 0;
public static double extPositionWhenLiftingStarted = 0;
public static double targetExtenderPosition = 0;
public Climber() {
extenderMotor.restoreFactoryDefaults();
extenderMotor.setIdleMode(IdleMode.kCoast);
extenderMotor.getPIDController().setOutputRange(-.3, .3);
extenderMotor.getPIDController().setP(1);
liftMotor.restoreFactoryDefaults();
liftMotor.setIdleMode(IdleMode.kBrake);
liftMotor.getPIDController().setOutputRange(-1, 1);
liftMotor.getPIDController().setP(1);
}
public static Climber getInstance() {
if (instance == null) {
instance = new Climber();
}
return instance;
}
public static void tick() {
// we're actively climbing when we see acceleromter motion and the lift is at
// least half way up.
if (accelerometer.getY() > .1 &&
!isLifting &&
extenderMotor.getEncoder().getPosition() > (MAX_EXTENDED_POSITION / 2)) {
isLifting = true;
liftPositionWhenLiftingStarted = liftMotor.getEncoder().getPosition();
extPositionWhenLiftingStarted = extenderMotor.getEncoder().getPosition();
targetExtenderPosition = extenderMotor.getEncoder().getPosition();
}
if (isLifting) {
targetExtenderPosition = extPositionWhenLiftingStarted - (liftMotor.getEncoder().getPosition() - liftPositionWhenLiftingStarted );
// coordinate the extender motor with the lift motor
extenderMotor.getPIDController().setReference(targetExtenderPosition, ControlType.kPosition);
}
SmartDashboard.putNumber("Climb Extend Enc", extenderMotor.getEncoder().getPosition());
SmartDashboard.putNumber("Climb Lift Enc", liftMotor.getEncoder().getPosition());
SmartDashboard.putNumber("Accel X", accelerometer.getX());
SmartDashboard.putNumber("Accel Y", accelerometer.getY());
SmartDashboard.putNumber("Accel Z", accelerometer.getZ());
SmartDashboard.putBoolean("IsLifting", isLifting);
}
// extendHook - use for first main extension, then manual adjustment from there
public static void extendHook() {
extenderMotor.getPIDController().setReference(BASE_EXTENDED_POSITION, ControlType.kPosition);
}
public static void adjustExtendedHook(double direction) {
double newSetpoint;
if (direction > 0) {
newSetpoint = extenderMotor.getEncoder().getPosition() + (15);
if (newSetpoint >= MAX_EXTENDED_POSITION) {
newSetpoint = MAX_EXTENDED_POSITION;
}
} else {
newSetpoint = extenderMotor.getEncoder().getPosition() - (15);
if (newSetpoint < 0) {
newSetpoint = 0;
}
}
extenderMotor.getPIDController().setReference(newSetpoint, ControlType.kPosition);
}
public static void liftRobot(double direction) {
double newSetpoint;
if (direction > 0) {
newSetpoint = liftMotor.getEncoder().getPosition() + (15);
} else {
newSetpoint = liftMotor.getEncoder().getPosition() - (15);
if (newSetpoint < 0) {
newSetpoint = 0;
}
}
liftMotor.getPIDController().setReference(newSetpoint, ControlType.kPosition);
extenderMotor.set(-.1);
}
// public static void setColorWheelClimberPosition () {
// // GIVE SETPOINT FOR COLOR WHEEL CLIMBER POSITION
// }
// public static void setHighClimberPosition () {
// // GIVE SETPOINT FOR HIGH CLIMBER POSITION
// }
}
|
3e075192999220606953ecadef02533bde50e5d0
| 1,739 |
java
|
Java
|
src/test/java/org/devzendo/minimiser/gui/menu/StubRecentFilesList.java
|
devzendo/mini-miser
|
ca5fc0ffd7f9d4f39d378759df9946bd4f0e1c89
|
[
"Apache-2.0"
] | null | null | null |
src/test/java/org/devzendo/minimiser/gui/menu/StubRecentFilesList.java
|
devzendo/mini-miser
|
ca5fc0ffd7f9d4f39d378759df9946bd4f0e1c89
|
[
"Apache-2.0"
] | 1 |
2022-01-21T23:38:27.000Z
|
2022-01-21T23:38:27.000Z
|
src/test/java/org/devzendo/minimiser/gui/menu/StubRecentFilesList.java
|
devzendo/mini-miser
|
ca5fc0ffd7f9d4f39d378759df9946bd4f0e1c89
|
[
"Apache-2.0"
] | null | null | null | 25.955224 | 82 | 0.683726 | 3,101 |
/**
* Copyright (C) 2008-2010 Matt Gumbley, DevZendo.org <http://devzendo.org>
*
* 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.devzendo.minimiser.gui.menu;
import java.util.ArrayList;
import java.util.List;
import org.devzendo.minimiser.openlist.DatabaseDescriptor;
import org.devzendo.minimiser.recentlist.AbstractRecentFilesListImpl;
/**
* A stub recent file list that accepts observers, and
* notifies them when changes occurs to the list, in the same manner as
* the real one, but with no backing store.
*
* @author matt
*
*/
public final class StubRecentFilesList extends AbstractRecentFilesListImpl {
/**
*
*/
public StubRecentFilesList() {
super();
}
/**
* Silently add a database
* @param databaseDescriptor the database to add
*/
public void addDatabaseSilently(final DatabaseDescriptor databaseDescriptor) {
addSilently(databaseDescriptor);
}
/**
* {@inheritDoc}
*/
@Override
protected List<DatabaseDescriptor> load() {
return new ArrayList<DatabaseDescriptor>();
}
/**
* {@inheritDoc}
*/
@Override
protected void save() {
// do nothing
}
}
|
3e075195c9e034f22b49c86bb123d444ee227c65
| 1,597 |
java
|
Java
|
testbench/testsolutions/editor.test/source_gen/jetbrains/mps/lang/editor/actions/test/Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl_Test.java
|
trespasserw/MPS
|
dbc5c76496e8ccef46dd420eefcd5089b1bc234b
|
[
"Apache-2.0"
] | null | null | null |
testbench/testsolutions/editor.test/source_gen/jetbrains/mps/lang/editor/actions/test/Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl_Test.java
|
trespasserw/MPS
|
dbc5c76496e8ccef46dd420eefcd5089b1bc234b
|
[
"Apache-2.0"
] | null | null | null |
testbench/testsolutions/editor.test/source_gen/jetbrains/mps/lang/editor/actions/test/Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl_Test.java
|
trespasserw/MPS
|
dbc5c76496e8ccef46dd420eefcd5089b1bc234b
|
[
"Apache-2.0"
] | null | null | null | 37.139535 | 259 | 0.799624 | 3,102 |
package jetbrains.mps.lang.editor.actions.test;
/*Generated by MPS */
import jetbrains.mps.MPSLaunch;
import jetbrains.mps.lang.test.runtime.BaseTransformationTest;
import org.junit.ClassRule;
import jetbrains.mps.lang.test.runtime.TestParametersCache;
import org.junit.Test;
import jetbrains.mps.lang.test.runtime.BaseEditorTestBody;
import jetbrains.mps.lang.test.runtime.TransformationTest;
import jetbrains.mps.internal.collections.runtime.ListSequence;
import java.util.ArrayList;
@MPSLaunch
public class Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl_Test extends BaseTransformationTest {
@ClassRule
public static final TestParametersCache ourParamCache = new TestParametersCache(Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl_Test.class, "${mps_home}", "r:c44f4b8c-137c-4225-8bd9-38d232a9b736(jetbrains.mps.lang.editor.actions.test)", false);
public Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl_Test() {
super(ourParamCache);
}
@Test
public void test_Subst_SingleChildDefaultConcreteDefEditor_AddNewChildByCompl() throws Throwable {
new TestBody(this).testMethod();
}
/*package*/ static class TestBody extends BaseEditorTestBody {
/*package*/ TestBody(TransformationTest owner) {
super(owner);
}
@Override
public void testMethodImpl() throws Exception {
initEditorComponent("893030362424993469", "893030362424993471");
invokeAction("jetbrains.mps.ide.editor.actions.Complete_Action");
pressKeys(ListSequence.fromListAndArray(new ArrayList<String>(), " ENTER"));
}
}
}
|
3e07521da0c33675950ff46dade01c11e9ca6a41
| 1,334 |
java
|
Java
|
src/main/java/org/primefaces/component/ring/Ring.java
|
efrenperez/primefaces
|
567cf913f6e5e48946f145dafcc798f97681c41b
|
[
"Apache-2.0"
] | 1 |
2018-08-27T13:42:27.000Z
|
2018-08-27T13:42:27.000Z
|
src/main/java/org/primefaces/component/ring/Ring.java
|
efrenperez/primefaces
|
567cf913f6e5e48946f145dafcc798f97681c41b
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/org/primefaces/component/ring/Ring.java
|
efrenperez/primefaces
|
567cf913f6e5e48946f145dafcc798f97681c41b
|
[
"Apache-2.0"
] | null | null | null | 40.424242 | 80 | 0.730885 | 3,103 |
/**
* Copyright 2009-2018 PrimeTek.
*
* 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.primefaces.component.ring;
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
@ResourceDependencies({
@ResourceDependency(library = "primefaces", name = "ring/ring.css"),
@ResourceDependency(library = "primefaces", name = "jquery/jquery.js"),
@ResourceDependency(library = "primefaces", name = "core.js"),
@ResourceDependency(library = "primefaces", name = "components.js"),
@ResourceDependency(library = "primefaces", name = "ring/ring.js")
})
public class Ring extends RingBase {
public static final String COMPONENT_TYPE = "org.primefaces.component.Ring";
public static final String STYLE_CLASS = "ui-ring ui-widget";
}
|
3e07539b56f1c65bd2ad20aca7b1c44b92dd33be
| 5,457 |
java
|
Java
|
src/main/java/com/microsoft/graph/models/extensions/AndroidDeviceOwnerEnrollmentProfile.java
|
isabella232/msgraph-beta-sdk-java
|
7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8
|
[
"MIT"
] | null | null | null |
src/main/java/com/microsoft/graph/models/extensions/AndroidDeviceOwnerEnrollmentProfile.java
|
isabella232/msgraph-beta-sdk-java
|
7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8
|
[
"MIT"
] | 1 |
2021-02-23T20:48:12.000Z
|
2021-02-23T20:48:12.000Z
|
src/main/java/com/microsoft/graph/models/extensions/AndroidDeviceOwnerEnrollmentProfile.java
|
isabella232/msgraph-beta-sdk-java
|
7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8
|
[
"MIT"
] | null | null | null | 30.149171 | 152 | 0.663368 | 3,104 |
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.models.extensions;
import com.microsoft.graph.serializer.ISerializer;
import com.microsoft.graph.serializer.IJsonBackedObject;
import com.microsoft.graph.serializer.AdditionalDataManager;
import java.util.EnumSet;
import com.microsoft.graph.models.generated.AndroidDeviceOwnerEnrollmentMode;
import com.microsoft.graph.models.generated.AndroidDeviceOwnerEnrollmentTokenType;
import com.microsoft.graph.models.extensions.MimeContent;
import com.microsoft.graph.models.extensions.Entity;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Android Device Owner Enrollment Profile.
*/
public class AndroidDeviceOwnerEnrollmentProfile extends Entity implements IJsonBackedObject {
/**
* The Account Id.
* Tenant GUID the enrollment profile belongs to.
*/
@SerializedName(value = "accountId", alternate = {"AccountId"})
@Expose
public String accountId;
/**
* The Created Date Time.
* Date time the enrollment profile was created.
*/
@SerializedName(value = "createdDateTime", alternate = {"CreatedDateTime"})
@Expose
public java.util.Calendar createdDateTime;
/**
* The Description.
* Description for the enrollment profile.
*/
@SerializedName(value = "description", alternate = {"Description"})
@Expose
public String description;
/**
* The Display Name.
* Display name for the enrollment profile.
*/
@SerializedName(value = "displayName", alternate = {"DisplayName"})
@Expose
public String displayName;
/**
* The Enrolled Device Count.
* Total number of Android devices that have enrolled using this enrollment profile.
*/
@SerializedName(value = "enrolledDeviceCount", alternate = {"EnrolledDeviceCount"})
@Expose
public Integer enrolledDeviceCount;
/**
* The Enrollment Mode.
* The enrollment mode of devices that use this enrollment profile.
*/
@SerializedName(value = "enrollmentMode", alternate = {"EnrollmentMode"})
@Expose
public AndroidDeviceOwnerEnrollmentMode enrollmentMode;
/**
* The Enrollment Token Type.
* The enrollment token type for an enrollment profile.
*/
@SerializedName(value = "enrollmentTokenType", alternate = {"EnrollmentTokenType"})
@Expose
public AndroidDeviceOwnerEnrollmentTokenType enrollmentTokenType;
/**
* The Last Modified Date Time.
* Date time the enrollment profile was last modified.
*/
@SerializedName(value = "lastModifiedDateTime", alternate = {"LastModifiedDateTime"})
@Expose
public java.util.Calendar lastModifiedDateTime;
/**
* The Qr Code Content.
* String used to generate a QR code for the token.
*/
@SerializedName(value = "qrCodeContent", alternate = {"QrCodeContent"})
@Expose
public String qrCodeContent;
/**
* The Qr Code Image.
* String used to generate a QR code for the token.
*/
@SerializedName(value = "qrCodeImage", alternate = {"QrCodeImage"})
@Expose
public MimeContent qrCodeImage;
/**
* The Role Scope Tag Ids.
* List of Scope Tags for this Entity instance.
*/
@SerializedName(value = "roleScopeTagIds", alternate = {"RoleScopeTagIds"})
@Expose
public java.util.List<String> roleScopeTagIds;
/**
* The Token Creation Date Time.
* Date time the most recently created token was created.
*/
@SerializedName(value = "tokenCreationDateTime", alternate = {"TokenCreationDateTime"})
@Expose
public java.util.Calendar tokenCreationDateTime;
/**
* The Token Expiration Date Time.
* Date time the most recently created token will expire.
*/
@SerializedName(value = "tokenExpirationDateTime", alternate = {"TokenExpirationDateTime"})
@Expose
public java.util.Calendar tokenExpirationDateTime;
/**
* The Token Value.
* Value of the most recently created token for this enrollment profile.
*/
@SerializedName(value = "tokenValue", alternate = {"TokenValue"})
@Expose
public String tokenValue;
/**
* The raw representation of this class
*/
private JsonObject rawObject;
/**
* The serializer
*/
private ISerializer serializer;
/**
* Gets the raw representation of this class
*
* @return the raw representation of this class
*/
public JsonObject getRawObject() {
return rawObject;
}
/**
* Gets serializer
*
* @return the serializer
*/
protected ISerializer getSerializer() {
return serializer;
}
/**
* Sets the raw JSON object
*
* @param serializer the serializer
* @param json the JSON object to set this object to
*/
public void setRawObject(final ISerializer serializer, final JsonObject json) {
this.serializer = serializer;
rawObject = json;
}
}
|
3e0753e9176f88cb2b831516b526ccf77250c9b9
| 877 |
java
|
Java
|
src/main/java/org/soundtouch4j/preset/Preset.java
|
geri-m/soundtouch4j
|
ab9de2ff57602a421fc167d72e5cd585e477a32a
|
[
"MIT"
] | 8 |
2018-09-10T20:18:00.000Z
|
2022-03-07T19:06:36.000Z
|
src/main/java/org/soundtouch4j/preset/Preset.java
|
geri-m/soundtouch4j
|
ab9de2ff57602a421fc167d72e5cd585e477a32a
|
[
"MIT"
] | 28 |
2018-09-11T18:48:21.000Z
|
2021-12-14T21:13:13.000Z
|
src/main/java/org/soundtouch4j/preset/Preset.java
|
geri-m/soundtouch4j
|
ab9de2ff57602a421fc167d72e5cd585e477a32a
|
[
"MIT"
] | 1 |
2021-11-14T13:48:25.000Z
|
2021-11-14T13:48:25.000Z
| 19.065217 | 136 | 0.665906 | 3,105 |
package org.soundtouch4j.preset;
import java.util.Date;
import org.soundtouch4j.common.ContentItem;
import com.google.api.client.util.Key;
public class Preset {
@Key("@id")
private int id;
@Key("@createdOn")
private int createdOn;
@Key("@updatedOn")
private int updatedOn;
@Key("ContentItem")
private ContentItem contentItem;
public Preset() {
// Auto Init/Reflection Requires Empty Constructor
}
public ContentItem getContentItem() {
return contentItem;
}
public int getId() {
return id;
}
public Date getCreatedOn() {
return new Date(createdOn * 1000L);
}
public Date getUpdatedOn() {
return new Date(updatedOn * 1000L);
}
@Override
public String toString() {
return "Preset{id=" + id + ", createdOn=" + getCreatedOn() + ", updatedOn=" + getUpdatedOn() + ", contentItem=" + contentItem + '}';
}
}
|
3e07545e87fef0432fd6ceb717f58c3bee9ec9a6
| 377 |
java
|
Java
|
app/src/main/java/com/javahelps/smartagent/sensor/LightSensor.java
|
slgobinath/smart-agent
|
63851a451898141741ffc7f256cb03d7d618b89b
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/javahelps/smartagent/sensor/LightSensor.java
|
slgobinath/smart-agent
|
63851a451898141741ffc7f256cb03d7d618b89b
|
[
"Apache-2.0"
] | null | null | null |
app/src/main/java/com/javahelps/smartagent/sensor/LightSensor.java
|
slgobinath/smart-agent
|
63851a451898141741ffc7f256cb03d7d618b89b
|
[
"Apache-2.0"
] | null | null | null | 20.944444 | 59 | 0.729443 | 3,106 |
package com.javahelps.smartagent.sensor;
import android.content.Context;
import com.javahelps.smartagent.util.Constant;
public class LightSensor extends EnvironmentSensor {
public LightSensor(Context context) {
super(context, android.hardware.Sensor.TYPE_LIGHT);
}
@Override
public String toString() {
return Constant.Sensor.LIGHT;
}
}
|
3e075520fb36cd18a65ce49ea627d92e2ef21cf3
| 11,230 |
java
|
Java
|
src/main/java/eu/newsreader/eventcoreference/objects/CompositeEvent.java
|
cltl/EventCoreference
|
f1de443975dfde8c017b12ee4e93b3ad34ecb777
|
[
"Apache-2.0"
] | 19 |
2015-07-01T21:54:43.000Z
|
2020-11-20T12:59:14.000Z
|
src/main/java/eu/newsreader/eventcoreference/objects/CompositeEvent.java
|
Filter-Bubble/EventCoreference
|
add0f2741dff40fd0ebcccf1d398ea83399b1a3f
|
[
"Apache-2.0"
] | 5 |
2016-04-18T10:50:26.000Z
|
2020-04-05T14:17:55.000Z
|
src/main/java/eu/newsreader/eventcoreference/objects/CompositeEvent.java
|
Filter-Bubble/EventCoreference
|
add0f2741dff40fd0ebcccf1d398ea83399b1a3f
|
[
"Apache-2.0"
] | 13 |
2015-03-04T15:07:51.000Z
|
2020-04-08T06:52:19.000Z
| 39.822695 | 199 | 0.542654 | 3,107 |
package eu.newsreader.eventcoreference.objects;
import eu.newsreader.eventcoreference.coref.ComponentMatch;
import eu.newsreader.eventcoreference.util.Util;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
/**
* Created by piek on 4/23/14.
*/
public class CompositeEvent implements Serializable{
private SemObject event;
private ArrayList<SemTime> mySemTimes;
private ArrayList<SemActor> mySemActors;
private ArrayList<SemRelation> mySemRelations;
public CompositeEvent() {
this.event = new SemObject(SemObject.EVENT);
this.mySemTimes = new ArrayList<SemTime>();
this.mySemActors = new ArrayList<SemActor>();
this.mySemRelations = new ArrayList<SemRelation>();
}
public CompositeEvent(SemEvent event,
ArrayList<SemActor> mySemActors,
ArrayList<SemTime> mySemTimes,
ArrayList<SemRelation> mySemRelations
) {
this.event = event;
this.mySemTimes = mySemTimes;
this.mySemActors = mySemActors;
this.mySemRelations = mySemRelations;
}
public boolean isValid (){
boolean hasParticipant = false;
boolean hasTime = false;
for (int i = 0; i < mySemRelations.size(); i++) {
SemRelation semRelation = mySemRelations.get(i);
for (int j = 0; j < semRelation.getPredicates().size(); j++) {
String predicate = semRelation.getPredicates().get(j);
if (predicate.endsWith(Sem.hasPlace.getLocalName()) || predicate.endsWith(Sem.hasActor.getLocalName())) {
//if (predicate.toLowerCase().endsWith("actor") || predicate.toLowerCase().endsWith("place")) {
hasParticipant = true;
}
if (SemRelation.isTemporalSemRelationProperty(predicate)) {
//if (predicate.toLowerCase().endsWith("time") || predicate.toLowerCase().endsWith("timestamp")) {
hasTime = true;
}
}
}
if (hasParticipant && hasTime) {
return true;
}
else {
return false;
}
}
public static ArrayList<SemTime> getDominantYear ( ArrayList<SemTime> myTimes) {
ArrayList<SemTime> domYearTimes = new ArrayList<SemTime>();
HashMap<String, Integer> yearCount = new HashMap<String, Integer>();
HashMap<String, ArrayList<SemTime>> yearMap = new HashMap<String, ArrayList<SemTime>>();
Integer topYear = 0;
String topYearString = "";
for (int i = 0; i < myTimes.size(); i++) {
SemTime semTime = myTimes.get(i);
String year = semTime.getOwlTime().getYear();
if (year.isEmpty()) {
year = semTime.getOwlTimeBegin().getYear();
}
if (year.isEmpty()) {
year = semTime.getOwlTimeEnd().getYear();
}
if (!year.isEmpty()) {
if (yearMap.containsKey(year)) {
ArrayList<SemTime> times = yearMap.get(year);
times.add(semTime);
yearMap.put(year, times);
}
else {
ArrayList<SemTime> times = new ArrayList<SemTime>();
times.add(semTime);
yearMap.put(year, times);
}
if (yearCount.containsKey(year)) {
Integer cnt = yearCount.get(year);
cnt++;
yearCount.put(year, cnt);
if (cnt>topYear) {
topYear = cnt;
topYearString = year;
}
}
else {
yearCount.put(year, 1);
if (topYear==0) {
topYearString = year;
topYear = 1;
}
}
}
}
domYearTimes = yearMap.get(topYearString);
//System.out.println("topYearString = " + topYearString);
return domYearTimes;
}
public SemObject getEvent() {
return event;
}
public void setEvent(SemObject event) {
this.event = event;
}
public ArrayList<SemTime> getMySemTimes() {
return mySemTimes;
}
public ArrayList<SemTime> getMyDominantSemTimes() {
return getDominantYear(mySemTimes);
}
public void setMySemTimes(ArrayList<SemTime> mySemTimes) {
this.mySemTimes = mySemTimes;
}
public void addMySemTime(SemTime mySemTime) {
this.mySemTimes.add(mySemTime);
}
public ArrayList<SemActor> getMySemActors() {
return mySemActors;
}
public void setMySemActors(ArrayList<SemActor> mySemActors) {
this.mySemActors = mySemActors;
}
public void addMySemActor(SemActor mySemActor) {
this.mySemActors.add(mySemActor);
}
public ArrayList<SemRelation> getMySemRelations() {
return mySemRelations;
}
public void setMySemRelations(ArrayList<SemRelation> mySemRelations) {
this.mySemRelations = mySemRelations;
}
public void addMySemRelation(SemRelation mySemRelation) {
this.mySemRelations.add(mySemRelation);
}
/*
@TODO fix true time value matches
*/
public void mergeRelations (CompositeEvent event) {
for (int i = 0; i < event.getMySemRelations().size(); i++) {
SemRelation semRelation = event.getMySemRelations().get(i);
boolean match = false;
for (int j = 0; j < this.getMySemRelations().size(); j++) {
SemRelation relation = this.getMySemRelations().get(j);
if ( (relation.containsPredicateIgnoreCase(Sem.hasTime.getLocalName()) && semRelation.containsPredicateIgnoreCase(Sem.hasTime.getLocalName()))
||(relation.containsPredicateIgnoreCase(Sem.hasBeginTimeStamp.getLocalName()) && semRelation.containsPredicateIgnoreCase(Sem.hasBeginTimeStamp.getLocalName()))
||(relation.containsPredicateIgnoreCase(Sem.hasEndTimeStamp.getLocalName()) && semRelation.containsPredicateIgnoreCase(Sem.hasEndTimeStamp.getLocalName()))
||(relation.containsPredicateIgnoreCase(Sem.hasEarliestBeginTimeStamp.getLocalName()) && semRelation.containsPredicateIgnoreCase(Sem.hasEarliestBeginTimeStamp.getLocalName()))
||(relation.containsPredicateIgnoreCase(Sem.hasEarliestEndTimeStamp.getLocalName()) && semRelation.containsPredicateIgnoreCase(Sem.hasEarliestEndTimeStamp.getLocalName()))
) {
//// make sure the doctime is also considered
if (Util.matchTimeReference(this.getMySemTimes(), event.getMySemTimes(), relation.getObject(), semRelation.getObject())) {
relation.addMentions(semRelation.getNafMentions());
// System.out.println("relation.getNafMentions().toString() = " + relation.getNafMentions().toString());
match = true;
break;
}
else {
/////
}
}
else if (ComponentMatch.equalSemRelation(semRelation, relation)) {
/// we already have this relation so we add the mentions
relation.addMentions(semRelation.getNafMentions());
match = true;
break;
}
}
if (!match) {
semRelation.setSubject(this.getEvent().getId());
// System.out.println("new semRelation = " + semRelation.toString());
this.addMySemRelation(semRelation);
}
}
}
public void mergeObjects (CompositeEvent event) {
for (int i = 0; i < event.getMySemActors().size(); i++) {
SemActor semActor1 = event.getMySemActors().get(i);
boolean match = false;
for (int j = 0; j < this.getMySemActors().size(); j++) {
SemActor semActor2 = this.getMySemActors().get(j);
if (semActor1.getURI().equals(semActor2.getURI())) {
// System.out.println("adding semActor1 = " + semActor1.getURI());
// System.out.println("adding semActor2 = " + semActor2.getURI());
semActor2.mergeSemObject(semActor1);
match = true;
break;
}
}
if (!match) {
// System.out.println("adding semActor1 = " + semActor1.getURI());
this.mySemActors.add(semActor1);
}
}
for (int i = 0; i < event.getMySemTimes().size(); i++) {
SemTime semTime1 = event.getMySemTimes().get(i);
boolean match = false;
for (int j = 0; j < this.getMySemTimes().size(); j++) {
SemTime semTime2 = this.getMySemTimes().get(j);
if (semTime1.getOwlTime().matchTimeExact(semTime2.getOwlTime())) {
// System.out.println("semTime1 = " + semTime1.getURI());
// System.out.println("semTime2 = " + semTime2.getURI());
semTime2.mergeSemObject(semTime1);
match = true;
break;
}
else if (semTime1.getOwlTimeBegin().matchTimeExact(semTime2.getOwlTimeBegin())) {
// System.out.println("semTime1 = " + semTime1.getURI());
// System.out.println("semTime2 = " + semTime2.getURI());
semTime2.mergeSemObject(semTime1);
match = true;
break;
}
else if (semTime1.getOwlTimeEnd().matchTimeExact(semTime2.getOwlTimeEnd())) {
// System.out.println("semTime1 = " + semTime1.getURI());
// System.out.println("semTime2 = " + semTime2.getURI());
semTime2.mergeSemObject(semTime1);
match = true;
break;
}
}
if (!match) {
// System.out.println("adding semTime1 = " + semTime1.getURI());
this.mySemTimes.add(semTime1);
}
}
}
public String toString () {
String str = this.event.getId();
str += this.event.getPhrase()+"\n";
for (int i = 0; i < mySemActors.size(); i++) {
SemActor semActor = mySemActors.get(i);
str += "\t"+semActor.getId()+"\n";
}
for (int i = 0; i < mySemTimes.size(); i++) {
SemTime semTime = mySemTimes.get(i);
str += "\t"+semTime.getId()+"\n";
}
for (int i = 0; i < mySemRelations.size(); i++) {
SemRelation semRelation = mySemRelations.get(i);
str += "\t"+semRelation.getSubject()+":"+semRelation.getPredicates().toString()+":"+semRelation.getObject()+"\n";
}
return str;
}
}
|
3e07558d7376a1084fe883dea0a0109e6b1a63ca
| 3,152 |
java
|
Java
|
service-goods/src/main/java/com/java110/goods/dao/impl/StoreOrderCartReturnEventServiceDaoImpl.java
|
osxhu/MicroCommunity
|
7b23ab0add380557d8778fb3e665682d0af8b196
|
[
"Apache-2.0"
] | 711 |
2017-04-09T15:59:16.000Z
|
2022-03-27T07:19:02.000Z
|
service-goods/src/main/java/com/java110/goods/dao/impl/StoreOrderCartReturnEventServiceDaoImpl.java
|
yasudarui/MicroCommunity
|
1026aa5eaa86446aedfdefd092a3d6fcf0dfe470
|
[
"Apache-2.0"
] | 16 |
2017-04-09T16:13:09.000Z
|
2022-01-04T16:36:13.000Z
|
service-goods/src/main/java/com/java110/goods/dao/impl/StoreOrderCartReturnEventServiceDaoImpl.java
|
yasudarui/MicroCommunity
|
1026aa5eaa86446aedfdefd092a3d6fcf0dfe470
|
[
"Apache-2.0"
] | 334 |
2017-04-16T05:01:12.000Z
|
2022-03-30T00:49:37.000Z
| 31.838384 | 175 | 0.732551 | 3,108 |
package com.java110.goods.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.goods.dao.IStoreOrderCartReturnEventServiceDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 退货事件服务 与数据库交互
* Created by wuxw on 2017/4/5.
*/
@Service("storeOrderCartReturnEventServiceDaoImpl")
//@Transactional
public class StoreOrderCartReturnEventServiceDaoImpl extends BaseServiceDao implements IStoreOrderCartReturnEventServiceDao {
private static Logger logger = LoggerFactory.getLogger(StoreOrderCartReturnEventServiceDaoImpl.class);
/**
* 保存退货事件信息 到 instance
* @param info bId 信息
* @throws DAOException DAO异常
*/
@Override
public void saveStoreOrderCartReturnEventInfo(Map info) throws DAOException {
logger.debug("保存退货事件信息Instance 入参 info : {}",info);
int saveFlag = sqlSessionTemplate.insert("storeOrderCartReturnEventServiceDaoImpl.saveStoreOrderCartReturnEventInfo",info);
if(saveFlag < 1){
throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存退货事件信息Instance数据失败:"+ JSONObject.toJSONString(info));
}
}
/**
* 查询退货事件信息(instance)
* @param info bId 信息
* @return List<Map>
* @throws DAOException DAO异常
*/
@Override
public List<Map> getStoreOrderCartReturnEventInfo(Map info) throws DAOException {
logger.debug("查询退货事件信息 入参 info : {}",info);
List<Map> businessStoreOrderCartReturnEventInfos = sqlSessionTemplate.selectList("storeOrderCartReturnEventServiceDaoImpl.getStoreOrderCartReturnEventInfo",info);
return businessStoreOrderCartReturnEventInfos;
}
/**
* 修改退货事件信息
* @param info 修改信息
* @throws DAOException DAO异常
*/
@Override
public void updateStoreOrderCartReturnEventInfo(Map info) throws DAOException {
logger.debug("修改退货事件信息Instance 入参 info : {}",info);
int saveFlag = sqlSessionTemplate.update("storeOrderCartReturnEventServiceDaoImpl.updateStoreOrderCartReturnEventInfo",info);
if(saveFlag < 1){
throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改退货事件信息Instance数据失败:"+ JSONObject.toJSONString(info));
}
}
/**
* 查询退货事件数量
* @param info 退货事件信息
* @return 退货事件数量
*/
@Override
public int queryStoreOrderCartReturnEventsCount(Map info) {
logger.debug("查询退货事件数据 入参 info : {}",info);
List<Map> businessStoreOrderCartReturnEventInfos = sqlSessionTemplate.selectList("storeOrderCartReturnEventServiceDaoImpl.queryStoreOrderCartReturnEventsCount", info);
if (businessStoreOrderCartReturnEventInfos.size() < 1) {
return 0;
}
return Integer.parseInt(businessStoreOrderCartReturnEventInfos.get(0).get("count").toString());
}
}
|
3e0755cf2f7ab257dd29ae1d47774fbde47ae804
| 1,189 |
java
|
Java
|
src/main/java/jpos/CoinDispenserControl12.java
|
BarelyAPrincess/AmeliaPOS
|
a8b1c6b542b2a338dda4e6292471e0910f0a7439
|
[
"MIT"
] | null | null | null |
src/main/java/jpos/CoinDispenserControl12.java
|
BarelyAPrincess/AmeliaPOS
|
a8b1c6b542b2a338dda4e6292471e0910f0a7439
|
[
"MIT"
] | null | null | null |
src/main/java/jpos/CoinDispenserControl12.java
|
BarelyAPrincess/AmeliaPOS
|
a8b1c6b542b2a338dda4e6292471e0910f0a7439
|
[
"MIT"
] | null | null | null | 34.257143 | 99 | 0.81568 | 3,109 |
/**
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
* <p>
* Copyright (c) 2019 Miss Amelia Sara (Millie) <[email protected]>
* Copyright (c) 2019 Penoaks Publishing LLC <[email protected]>
* <p>
* All Rights Reserved.
*/
package jpos;
import jpos.events.DirectIOListener;
import jpos.events.StatusUpdateListener;
public abstract interface CoinDispenserControl12 extends BaseControl
{
public abstract boolean getCapEmptySensor() throws JposException;
public abstract boolean getCapJamSensor() throws JposException;
public abstract boolean getCapNearEmptySensor() throws JposException;
public abstract int getDispenserStatus() throws JposException;
public abstract void dispenseChange( int paramInt ) throws JposException;
public abstract void addDirectIOListener( DirectIOListener paramDirectIOListener );
public abstract void removeDirectIOListener( DirectIOListener paramDirectIOListener );
public abstract void addStatusUpdateListener( StatusUpdateListener paramStatusUpdateListener );
public abstract void removeStatusUpdateListener( StatusUpdateListener paramStatusUpdateListener );
}
|
3e0756d1dd14c2b8bfc07a69c4ad07fbc9645b7c
| 567 |
java
|
Java
|
qirk-parent/qirk-chat-parent/qirk-chat-services/src/main/java/org/wrkr/clb/chat/services/jms/IssueChatListener.java
|
nydevel/qirk
|
8538826c6aec6bf9de9e59b9d5bd1849e2588c6a
|
[
"MIT"
] | 11 |
2020-11-04T05:58:23.000Z
|
2021-12-17T09:50:05.000Z
|
qirk-parent/qirk-chat-parent/qirk-chat-services/src/main/java/org/wrkr/clb/chat/services/jms/IssueChatListener.java
|
nydevel/qirk
|
8538826c6aec6bf9de9e59b9d5bd1849e2588c6a
|
[
"MIT"
] | null | null | null |
qirk-parent/qirk-chat-parent/qirk-chat-services/src/main/java/org/wrkr/clb/chat/services/jms/IssueChatListener.java
|
nydevel/qirk
|
8538826c6aec6bf9de9e59b9d5bd1849e2588c6a
|
[
"MIT"
] | 7 |
2020-11-04T15:28:02.000Z
|
2022-03-01T11:31:29.000Z
| 33.352941 | 170 | 0.798942 | 3,110 |
package org.wrkr.clb.chat.services.jms;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.wrkr.clb.chat.services.jms.MQDestination;
public class IssueChatListener extends ChatListener {
private Map<Long, ConcurrentHashMap<String, MQDestination>> chatIdToSessionIdsToControllers = new ConcurrentHashMap<Long, ConcurrentHashMap<String, MQDestination>>();
@Override
protected Map<Long, ConcurrentHashMap<String, MQDestination>> getChatIdToSessionIdsToControllers() {
return chatIdToSessionIdsToControllers;
}
}
|
3e0757737464271193b6c2babbea08b7380c1d89
| 6,582 |
java
|
Java
|
src/main/java/nl/tudelft/ewi/sorcerers/AppConfig.java
|
theSorcerers/octopull
|
b131bc57d2a3aaa6f8d2563b5dd05e2fa4789ac1
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/nl/tudelft/ewi/sorcerers/AppConfig.java
|
theSorcerers/octopull
|
b131bc57d2a3aaa6f8d2563b5dd05e2fa4789ac1
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/nl/tudelft/ewi/sorcerers/AppConfig.java
|
theSorcerers/octopull
|
b131bc57d2a3aaa6f8d2563b5dd05e2fa4789ac1
|
[
"Apache-2.0"
] | null | null | null | 40.881988 | 117 | 0.772713 | 3,111 |
package nl.tudelft.ewi.sorcerers;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import nl.tudelft.ewi.sorcerers.github.CommitServiceFactory;
import nl.tudelft.ewi.sorcerers.github.GitHubClientFactory;
import nl.tudelft.ewi.sorcerers.github.GitHubCompareService;
import nl.tudelft.ewi.sorcerers.github.GitHubReviewService;
import nl.tudelft.ewi.sorcerers.github.LineMapService;
import nl.tudelft.ewi.sorcerers.github.PullRequestServiceFactory;
import nl.tudelft.ewi.sorcerers.infrastructure.JPAPageViewRepository;
import nl.tudelft.ewi.sorcerers.infrastructure.JPAWarningCommentRepository;
import nl.tudelft.ewi.sorcerers.infrastructure.JPAWarningRepository;
import nl.tudelft.ewi.sorcerers.model.CommentService;
import nl.tudelft.ewi.sorcerers.model.CompareService;
import nl.tudelft.ewi.sorcerers.model.PageViewRepository;
import nl.tudelft.ewi.sorcerers.model.ReviewService;
import nl.tudelft.ewi.sorcerers.model.WarningCommentRepository;
import nl.tudelft.ewi.sorcerers.model.WarningRepository;
import nl.tudelft.ewi.sorcerers.model.WarningService;
import nl.tudelft.ewi.sorcerers.servlet.BaseURIFilter;
import nl.tudelft.ewi.sorcerers.servlet.CORSResponseFilter;
import nl.tudelft.ewi.sorcerers.servlet.GitHubOAuthFilter;
import nl.tudelft.ewi.sorcerers.servlet.GitHubResponseCookieFilter;
import nl.tudelft.ewi.sorcerers.usecases.CreateCommentFromWarning;
import nl.tudelft.ewi.sorcerers.usecases.GetWarningsForCommit;
import nl.tudelft.ewi.sorcerers.usecases.GetWarningsForDiff;
import nl.tudelft.ewi.sorcerers.usecases.StorePageView;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.CommitService;
import org.eclipse.egit.github.core.service.PullRequestService;
import org.glassfish.hk2.api.Immediate;
import org.glassfish.hk2.api.InjectionResolver;
import org.glassfish.hk2.api.InterceptionService;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.api.TypeLiteral;
import org.glassfish.hk2.utilities.ServiceLocatorUtilities;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.process.internal.RequestScoped;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.server.filter.RolesAllowedDynamicFeature;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
public class AppConfig extends ResourceConfig {
@Inject
public AppConfig(ServiceLocator serviceLocator) {
packages("nl.tudelft.ewi.sorcerers.resources");
System.out.println("Registering injectables...");
ServiceLocatorUtilities.enableImmediateScope(serviceLocator);
register(BaseURIFilter.class);
register(JacksonJaxbJsonProvider.class);
register(CORSResponseFilter.class);
register(GitHubOAuthFilter.class);
register(GitHubResponseCookieFilter.class);
register(RolesAllowedDynamicFeature.class);
register(ForbiddenExceptionMapper.class);
final String githubToken = System.getenv("GITHUB_TOKEN");
if (githubToken == null) {
throw new IllegalArgumentException("GITHUB_TOKEN is missing.");
}
final String githubClientId = System.getenv("GITHUB_CLIENT_ID");
if (githubClientId == null) {
throw new IllegalArgumentException("GITHUB_CLIENT_ID is missing.");
}
final String githubClientSecret = System.getenv("GITHUB_CLIENT_SECRET");
if (githubClientSecret == null) {
throw new IllegalArgumentException("GITHUB_CLIENT_SECRET is missing.");
}
register(new AbstractBinder() {
@Override
protected void configure() {
bind(LoggerResolver.class).to(new TypeLiteral<InjectionResolver<Inject>>() {}).in(Singleton.class).ranked(100);;
}
});
register(new AbstractBinder() {
@Override
protected void configure() {
bind(githubToken).named("env:GITHUB_TOKEN").to(String.class);
bind(githubClientId).named("env:GITHUB_CLIENT_ID").to(String.class);
bind(githubClientSecret).named("env:GITHUB_CLIENT_SECRET").to(String.class);
bindAsContract(TravisService.class);
}
});
final String postgresUrl = System.getenv("POSTGRES_URL");
if (postgresUrl == null) {
throw new IllegalArgumentException("POSTGRES_URL is missing.");
}
register(new AbstractBinder() {
@Override
protected void configure() {
bind(postgresUrl).named("env:POSTGRES_URL").to(String.class);
bindFactory(HKEntityManagerFactoryFactory.class).to(EntityManagerFactory.class).in(Immediate.class);
bindFactory(HKEntityManagerFactory.class).to(EntityManager.class).in(RequestScoped.class);
bind(TransactionInterceptionService.class).to(InterceptionService.class).in(Singleton.class);
bind(JPAWarningRepository.class).to(WarningRepository.class).in(RequestScoped.class);
bind(JPAWarningCommentRepository.class).to(WarningCommentRepository.class).in(RequestScoped.class);
bind(JPAPageViewRepository.class).to(PageViewRepository.class).in(RequestScoped.class);
}
});
register(new AbstractBinder() {
@Override
protected void configure() {
bindFactory(GitHubClientFactory.class).to(GitHubClient.class).in(RequestScoped.class);
bindFactory(PullRequestServiceFactory.class).to(PullRequestService.class).in(RequestScoped.class);
bindFactory(CommitServiceFactory.class).to(CommitService.class).in(RequestScoped.class);
bind(GitHubCompareService.class).to(CompareService.class).in(Singleton.class);
bind(GitHubReviewService.class).to(ReviewService.class).in(Singleton.class);
}
});
register(new AbstractBinder() {
@Override
protected void configure() {
bindAsContract(GetWarningsForCommit.class);
bindAsContract(GetWarningsForDiff.class);
bindAsContract(CreateCommentFromWarning.class);
bindAsContract(StorePageView.class);
}
});
register(new AbstractBinder() {
@Override
protected void configure() {
bindAsContract(CommentService.class);
bindAsContract(WarningService.class);
bindAsContract(LineMapService.class);
}
});
register(new AbstractBinder() {
@Override
protected void configure() {
bind(CheckstyleLogParser.class).named("checkstyle").to(LogParser.class);
bind(PMDLogParser.class).named("pmd").to(LogParser.class);
bind(FindBugsLogParser.class).named("findbugs").to(LogParser.class);
}
});
}
}
|
3e0757e4a9714cbdcc502e7b20ae7371b871e7b0
| 2,714 |
java
|
Java
|
src/main/java/org/embl/mobie/io/ome/zarr/util/N5ZarrImageReaderHelper.java
|
mobie/mobie-io
|
3686f3469fb7665ff16eae55f59f82692012e216
|
[
"MIT"
] | 1 |
2021-12-03T08:50:01.000Z
|
2021-12-03T08:50:01.000Z
|
src/main/java/org/embl/mobie/io/ome/zarr/util/N5ZarrImageReaderHelper.java
|
mobie/mobie-io
|
3686f3469fb7665ff16eae55f59f82692012e216
|
[
"MIT"
] | 56 |
2021-09-14T07:40:59.000Z
|
2022-03-23T12:40:42.000Z
|
src/main/java/org/embl/mobie/io/ome/zarr/util/N5ZarrImageReaderHelper.java
|
mobie/mobie-io
|
3686f3469fb7665ff16eae55f59f82692012e216
|
[
"MIT"
] | 2 |
2022-01-26T15:59:26.000Z
|
2022-02-02T18:04:42.000Z
| 37.694444 | 128 | 0.708917 | 3,112 |
package org.embl.mobie.io.ome.zarr.util;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.reflect.TypeToken;
import org.janelia.saalfeldlab.n5.DataBlock;
import org.janelia.saalfeldlab.n5.DatasetAttributes;
import org.janelia.saalfeldlab.n5.N5FSReader;
import org.janelia.saalfeldlab.n5.zarr.DType;
import org.janelia.saalfeldlab.n5.zarr.Filter;
import org.janelia.saalfeldlab.n5.zarr.ZarrCompressor;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
public class N5ZarrImageReaderHelper extends N5FSReader {
public N5ZarrImageReaderHelper(GsonBuilder gsonBuilder) throws IOException {
super("", gsonBuilder);
}
public N5ZarrImageReaderHelper(String basePath, GsonBuilder gsonBuilder) throws IOException {
super(basePath, gsonBuilder);
}
public ZArrayAttributes getN5DatasetAttributes(@NotNull HashMap<String, JsonElement> attributes) throws IOException {
if (attributes.isEmpty()) {
throw new IOException("Empty ZArray attributes");
}
return new ZArrayAttributes(
attributes.get("zarr_format").getAsInt(),
gson.fromJson(attributes.get("shape"), long[].class),
gson.fromJson(attributes.get("chunks"), int[].class),
gson.fromJson(attributes.get("dtype"), DType.class),
gson.fromJson(attributes.get("compressor"), ZarrCompressor.class),
attributes.get("fill_value").getAsString(),
attributes.get("order").getAsCharacter(),
gson.fromJson(attributes.get("filters"), TypeToken.getParameterized(Collection.class, Filter.class).getType()));
}
public void putAttributes(HashMap<String, JsonElement> attributes, DatasetAttributes datasetAttributes) {
attributes.put("dimensions", gson.toJsonTree(datasetAttributes.getDimensions()));
attributes.put("blockSize", gson.toJsonTree(datasetAttributes.getBlockSize()));
attributes.put("dataType", gson.toJsonTree(datasetAttributes.getDataType()));
attributes.put("compression", gson.toJsonTree(datasetAttributes.getCompression()));
}
@Override
public HashMap<String, JsonElement> getAttributes(String pathName) {
return null;
}
@Override
public DataBlock<?> readBlock(String pathName, DatasetAttributes datasetAttributes, long[] gridPosition) {
return null;
}
@Override
public boolean exists(String pathName) {
return false;
}
@Override
public String[] list(String pathName) throws IOException {
return new String[0];
}
}
|
3e0758b102fafc592b86c005903c4d37e41cbc8a
| 426 |
java
|
Java
|
security-core/src/main/java/com/example/security/core/properties/ImageCodeProperties.java
|
chenqianwen/springsecurity
|
37d5ad680c5fe638b32d6ba4b52b5d5df54a3ca3
|
[
"MIT"
] | null | null | null |
security-core/src/main/java/com/example/security/core/properties/ImageCodeProperties.java
|
chenqianwen/springsecurity
|
37d5ad680c5fe638b32d6ba4b52b5d5df54a3ca3
|
[
"MIT"
] | null | null | null |
security-core/src/main/java/com/example/security/core/properties/ImageCodeProperties.java
|
chenqianwen/springsecurity
|
37d5ad680c5fe638b32d6ba4b52b5d5df54a3ca3
|
[
"MIT"
] | null | null | null | 15.214286 | 59 | 0.575117 | 3,113 |
package com.example.security.core.properties;
import lombok.Data;
/**
* @author: ygl
* @date: 2018/2/7-13:07
* @Description:
* 图片验证码配置项
*/
@Data
public class ImageCodeProperties extends SmsCodeProperties{
/**
* 默认宽度
*/
private int width = 67;
/**
* 默认高度
*/
private int height = 23;
/**
* 默认设置4位长度的验证码
*/
public ImageCodeProperties() {
setLength(4);
}
}
|
3e075aba4f288fd66b874952f0da88437ad720bd
| 5,496 |
java
|
Java
|
src/main/java/com/matt/forgehax/mods/VanillaFlyMod.java
|
MikelAx7/DonHack-Client
|
8a3daedec3502196ab87dec810ed285f72165e92
|
[
"MIT"
] | 78 |
2020-11-26T23:37:38.000Z
|
2021-04-15T08:45:49.000Z
|
src/main/java/com/matt/forgehax/mods/VanillaFlyMod.java
|
MikelAx7/DonHack-Client
|
8a3daedec3502196ab87dec810ed285f72165e92
|
[
"MIT"
] | 1 |
2021-01-27T19:22:26.000Z
|
2021-01-27T19:22:26.000Z
|
src/main/java/com/matt/forgehax/mods/VanillaFlyMod.java
|
MikelAx7/DonHack-Client
|
8a3daedec3502196ab87dec810ed285f72165e92
|
[
"MIT"
] | 8 |
2020-06-09T03:40:48.000Z
|
2020-09-25T19:06:19.000Z
| 35.230769 | 119 | 0.691594 | 3,114 |
package com.matt.forgehax.mods;
import static com.matt.forgehax.Helper.getLocalPlayer;
import static com.matt.forgehax.util.entity.LocalPlayerUtils.getFlySwitch;
import static java.util.Objects.isNull;
import com.matt.forgehax.asm.events.PacketEvent;
import com.matt.forgehax.asm.reflection.FastReflection.Fields;
import com.matt.forgehax.events.LocalPlayerUpdateEvent;
import com.matt.forgehax.util.Switch.Handle;
import com.matt.forgehax.util.command.Setting;
import com.matt.forgehax.util.mod.Category;
import com.matt.forgehax.util.mod.ToggleMod;
import com.matt.forgehax.util.mod.loader.RegisterMod;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.client.CPacketPlayer;
import net.minecraft.network.play.server.SPacketPlayerPosLook;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@RegisterMod
public class VanillaFlyMod extends ToggleMod {
private Handle fly = getFlySwitch().createHandle(getModName());
@SuppressWarnings("WeakerAccess")
public final Setting<Boolean> groundSpoof =
getCommandStub()
.builders()
.<Boolean>newSettingBuilder()
.name("spoof")
.description("make the server think we are on the ground while flying")
.defaultTo(false)
.build();
@SuppressWarnings("WeakerAccess")
public final Setting<Boolean> antiGround =
getCommandStub()
.builders()
.<Boolean>newSettingBuilder()
.name("antiground")
.description("attempts to prevent the server from teleporting us to the ground")
.defaultTo(true)
.build();
@SuppressWarnings("WeakerAccess")
public final Setting<Float> flySpeed =
getCommandStub()
.builders()
.<Float>newSettingBuilder()
.name("speed")
.description("fly speed as a multiplier of the default")
.min(0f)
.max(5f)
.defaultTo(1f)
.build();
public VanillaFlyMod() {
super(Category.MOVEMENT, "VanillaFly", false, "Fly like creative mode");
}
@Override
protected void onEnabled() {
fly.enable();
}
@Override
protected void onDisabled() {
fly.disable();
}
@SubscribeEvent
public void onLocalPlayerUpdate(LocalPlayerUpdateEvent event) {
EntityPlayer player = getLocalPlayer();
if (isNull(player)) {
return;
}
if (!player.capabilities.allowFlying) {
fly.disable();
fly.enable();
player.capabilities.isFlying = false;
}
player.capabilities.setFlySpeed(0.05f * flySpeed.get());
}
@SubscribeEvent
public void onPacketSending(PacketEvent.Outgoing.Pre event) {
EntityPlayer player = getLocalPlayer();
if (isNull(player)) {
return;
}
if (!groundSpoof.get() || !(event.getPacket() instanceof CPacketPlayer)
|| !player.capabilities.isFlying) {
return;
}
CPacketPlayer packet = event.getPacket();
if (!Fields.CPacketPlayer_moving.get(packet)) {
return;
}
AxisAlignedBB range = player.getEntityBoundingBox().expand(0, -player.posY, 0)
.contract(0, -player.height, 0);
List<AxisAlignedBB> collisionBoxes = player.world.getCollisionBoxes(player, range);
AtomicReference<Double> newHeight = new AtomicReference<>(0D);
collisionBoxes.forEach(box -> newHeight.set(Math.max(newHeight.get(), box.maxY)));
Fields.CPacketPlayer_y.set(packet, newHeight.get());
Fields.CPacketPlayer_onGround.set(packet, true);
}
@SubscribeEvent
public void onPacketRecieving(PacketEvent.Incoming.Pre event) {
EntityPlayer player = getLocalPlayer();
if (isNull(player)) {
return;
}
if (!antiGround.get() || !(event.getPacket() instanceof SPacketPlayerPosLook)
|| !player.capabilities.isFlying) {
return;
}
SPacketPlayerPosLook packet = event.getPacket();
double oldY = player.posY;
player.setPosition(
Fields.SPacketPlayer_x.get(packet),
Fields.SPacketPlayer_y.get(packet),
Fields.SPacketPlayer_z.get(packet)
);
/*
* This needs a little explanation, as I had a little trouble wrapping my head around it myself.
* Basically, we're trying to find a new position that's as close to the original height as possible.
* That way, if you're, for example, spoofing and the server rubberbands you back, you don't go back to the ground.
* This tries to find the lowest block above the spot the server teleported you to, and teleport you right to that.
* If the lowest block is below where you were before, it just teleports you to where you were before.
* This allows VanillaFly to be slightly more usable on servers like Constantiam that like to teleport you in place
* to hopefully disable fly hacks. Well, sorry guys, this fly hack is smarter than that.
*/
AxisAlignedBB range = player.getEntityBoundingBox()
.expand(0, 256 - player.height - player.posY, 0).contract(0, player.height, 0);
List<AxisAlignedBB> collisionBoxes = player.world.getCollisionBoxes(player, range);
AtomicReference<Double> newY = new AtomicReference<>(256D);
collisionBoxes.forEach(box -> newY.set(Math.min(newY.get(), box.minY - player.height)));
Fields.SPacketPlayer_y.set(packet, Math.min(oldY, newY.get()));
}
}
|
3e075b1c387ee6ab3fd1cbb31d5f2f4ace843fc9
| 13,283 |
java
|
Java
|
android/testSrc/com/android/tools/idea/gradle/model/stubs/AndroidArtifactStub.java
|
phpc0de/idea-android
|
79e20f027ca1d047b91aa7acd92fb71fa2968a09
|
[
"Apache-2.0"
] | null | null | null |
android/testSrc/com/android/tools/idea/gradle/model/stubs/AndroidArtifactStub.java
|
phpc0de/idea-android
|
79e20f027ca1d047b91aa7acd92fb71fa2968a09
|
[
"Apache-2.0"
] | null | null | null |
android/testSrc/com/android/tools/idea/gradle/model/stubs/AndroidArtifactStub.java
|
phpc0de/idea-android
|
79e20f027ca1d047b91aa7acd92fb71fa2968a09
|
[
"Apache-2.0"
] | null | null | null | 37.522599 | 100 | 0.622977 | 3,115 |
/*
* Copyright (C) 2017 The Android Open Source Project
*
* 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 com.android.tools.idea.gradle.model.stubs;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
import com.android.builder.model.*;
import com.android.builder.model.level2.DependencyGraphs;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import java.io.File;
import java.util.*;
public class AndroidArtifactStub extends BaseArtifactStub implements AndroidArtifact {
@NonNull private final Collection<AndroidArtifactOutput> myOutputs;
@NonNull private final String myApplicationId;
@NonNull private final String mySourceGenTaskName;
@NonNull private final Collection<File> myGeneratedResourceFolders = new ArrayList<>();
@NonNull private final Collection<File> myAdditionalRuntimeApks;
@NonNull private final InstantRun myInstantRun;
@Nullable private final TestOptions myTestOptions;
@Nullable private final String mySigningConfigName;
@Nullable private final Set<String> myAbiFilters;
@Nullable private final String myInstrumentedTestTaskName;
@Nullable private final String myBundleTaskName;
@Nullable private final File myPostBundleTaskModelFile;
@Nullable private final String myApkFromBundleTaskName;
@Nullable private final File myPostApkFromBundleTaskModelFile;
@Nullable private final CodeShrinker myCodeShrinker;
private final boolean mySigned;
public AndroidArtifactStub(@NonNull String name) {
super(name);
myOutputs = Lists.newArrayList(new AndroidArtifactOutputStub());
myApplicationId = "applicationId";
mySourceGenTaskName = "sourceGenTaskName";
myInstantRun = new InstantRunStub();
mySigningConfigName = "signingConfigName";
myAbiFilters = Sets.newHashSet("filter");
myAdditionalRuntimeApks = Collections.emptyList();
myTestOptions = new TestOptionsStub();
myInstrumentedTestTaskName = "instrumentedTestsTaskName";
myBundleTaskName = "bundleTaskName";
myPostBundleTaskModelFile = new File("bundleTaskModelFile");
myApkFromBundleTaskName = "apkFromBundleTaskNam";
myPostApkFromBundleTaskModelFile = new File("apkFromBundleModelFile");
mySigned = true;
myCodeShrinker = null;
}
public AndroidArtifactStub(
@NonNull String name,
@NonNull String compileTaskName,
@NonNull String assembleTaskName,
@NonNull File postAssembleTaskModelFile,
@NonNull File classesFolder,
@NonNull Set<File> classesFolders,
@NonNull File javaResourcesFolder,
@NonNull Dependencies dependencies,
@NonNull Dependencies compileDependencies,
@NonNull DependencyGraphs graphs,
@NonNull Set<String> ideSetupTaskNames,
@NonNull Collection<File> folders,
@Nullable SourceProvider variantSourceProvider,
@Nullable SourceProvider multiFlavorSourceProvider,
@NonNull Collection<AndroidArtifactOutput> outputs,
@NonNull String applicationId,
@NonNull String sourceGenTaskName,
@NonNull Map<String, ClassField> buildConfigFields,
@NonNull Map<String, ClassField> resValues,
@NonNull InstantRun run,
@Nullable String signingConfigName,
@Nullable Set<String> filters,
@NonNull Collection<File> apks,
@Nullable TestOptions testOptions,
@Nullable String instrumentedTestTaskName,
@Nullable String bundleTaskName,
@Nullable File postBundleTaskModelFile,
@Nullable String apkFromBundleTaskName,
@Nullable File postApkFromBundleTaskModelFile,
@Nullable CodeShrinker codeShrinker,
boolean signed) {
super(
name,
compileTaskName,
assembleTaskName,
postAssembleTaskModelFile,
classesFolder,
classesFolders,
javaResourcesFolder,
dependencies,
compileDependencies,
graphs,
ideSetupTaskNames,
folders,
variantSourceProvider,
multiFlavorSourceProvider);
myOutputs = outputs;
myApplicationId = applicationId;
mySourceGenTaskName = sourceGenTaskName;
myInstantRun = run;
mySigningConfigName = signingConfigName;
myAbiFilters = filters;
myAdditionalRuntimeApks = apks;
myTestOptions = testOptions;
myInstrumentedTestTaskName = instrumentedTestTaskName;
myBundleTaskName = bundleTaskName;
myPostBundleTaskModelFile = postBundleTaskModelFile;
myApkFromBundleTaskName = apkFromBundleTaskName;
myPostApkFromBundleTaskModelFile = postApkFromBundleTaskModelFile;
myCodeShrinker = codeShrinker;
mySigned = signed;
}
@Override
@NonNull
public Collection<AndroidArtifactOutput> getOutputs() {
return myOutputs;
}
@Override
@NonNull
public String getApplicationId() {
return myApplicationId;
}
@Override
@NonNull
public String getSourceGenTaskName() {
return mySourceGenTaskName;
}
@Override
@NonNull
public Collection<File> getGeneratedResourceFolders() {
return myGeneratedResourceFolders;
}
@Override
@NonNull
public Map<String, ClassField> getResValues() {
return Collections.emptyMap();
}
@Override
@NonNull
public InstantRun getInstantRun() {
return myInstantRun;
}
@NonNull
@Override
public Collection<File> getAdditionalRuntimeApks() {
return myAdditionalRuntimeApks;
}
@Nullable
@Override
public TestOptions getTestOptions() {
return myTestOptions;
}
@Nullable
@Override
public String getInstrumentedTestTaskName() {
return myInstrumentedTestTaskName;
}
@Nullable
@Override
public String getBundleTaskName() {
return myBundleTaskName;
}
@Nullable
@Override
public String getBundleTaskOutputListingFile() {
return myPostBundleTaskModelFile != null ? myPostBundleTaskModelFile.getAbsolutePath() : "";
}
@Nullable
@Override
public String getApkFromBundleTaskName() {
return myApkFromBundleTaskName;
}
@Nullable
@Override
public String getApkFromBundleTaskOutputListingFile() {
return myPostApkFromBundleTaskModelFile != null
? myPostApkFromBundleTaskModelFile.getAbsolutePath()
: "";
}
@Nullable
@Override
public CodeShrinker getCodeShrinker() {
return myCodeShrinker;
}
@Override
@Nullable
public String getSigningConfigName() {
return mySigningConfigName;
}
@Override
@Nullable
public Set<String> getAbiFilters() {
return myAbiFilters;
}
@Override
@Nullable
public Collection<NativeLibrary> getNativeLibraries() {
return null;
}
@Override
public boolean isSigned() {
return mySigned;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof AndroidArtifact)) {
return false;
}
AndroidArtifact artifact = (AndroidArtifact) o;
return Objects.equals(getName(), artifact.getName())
&& Objects.equals(getCompileTaskName(), artifact.getCompileTaskName())
&& Objects.equals(getAssembleTaskName(), artifact.getAssembleTaskName())
&& Objects.equals(getClassesFolder(), artifact.getClassesFolder())
&& Objects.equals(getJavaResourcesFolder(), artifact.getJavaResourcesFolder())
&& Objects.equals(getDependencies(), artifact.getDependencies())
&& Objects.equals(getCompileDependencies(), artifact.getCompileDependencies())
&& Objects.equals(getDependencyGraphs(), artifact.getDependencyGraphs())
&& Objects.equals(getIdeSetupTaskNames(), artifact.getIdeSetupTaskNames())
&& Objects.equals(getGeneratedSourceFolders(), artifact.getGeneratedSourceFolders())
&& Objects.equals(getVariantSourceProvider(), artifact.getVariantSourceProvider())
&& Objects.equals(
getMultiFlavorSourceProvider(), artifact.getMultiFlavorSourceProvider())
&& isSigned() == artifact.isSigned()
&& Objects.equals(getOutputs(), artifact.getOutputs())
&& Objects.equals(getApplicationId(), artifact.getApplicationId())
&& Objects.equals(getSourceGenTaskName(), artifact.getSourceGenTaskName())
&& Objects.equals(
getGeneratedResourceFolders(), artifact.getGeneratedResourceFolders())
&& equals(artifact, AndroidArtifact::getInstantRun)
&& Objects.equals(getSigningConfigName(), artifact.getSigningConfigName())
&& Objects.equals(getAbiFilters(), artifact.getAbiFilters())
&& Objects.equals(getAdditionalRuntimeApks(), artifact.getAdditionalRuntimeApks())
&& Objects.equals(getTestOptions(), artifact.getTestOptions())
&& Objects.equals(
getInstrumentedTestTaskName(), artifact.getInstrumentedTestTaskName())
&& Objects.equals(getBundleTaskName(), artifact.getBundleTaskName())
&& Objects.equals(
getBundleTaskOutputListingFile(), artifact.getBundleTaskOutputListingFile())
&& Objects.equals(getApkFromBundleTaskName(), artifact.getApkFromBundleTaskName())
&& Objects.equals(
getApkFromBundleTaskOutputListingFile(),
artifact.getApkFromBundleTaskOutputListingFile())
&& Objects.equals(getNativeLibraries(), artifact.getNativeLibraries());
}
@Override
public int hashCode() {
return Objects.hash(
getName(),
getCompileTaskName(),
getAssembleTaskName(),
getClassesFolder(),
getJavaResourcesFolder(),
getDependencies(),
getCompileDependencies(),
getDependencyGraphs(),
getIdeSetupTaskNames(),
getGeneratedSourceFolders(),
getVariantSourceProvider(),
getMultiFlavorSourceProvider(),
getOutputs(),
getApplicationId(),
getSourceGenTaskName(),
getGeneratedResourceFolders(),
getInstantRun(),
getSigningConfigName(),
getAbiFilters(),
getNativeLibraries(),
isSigned(),
getAdditionalRuntimeApks(),
getTestOptions(),
getInstrumentedTestTaskName(),
getBundleTaskName(),
getBundleTaskOutputListingFile(),
getApkFromBundleTaskName(),
getApkFromBundleTaskOutputListingFile());
}
@Override
public String toString() {
return "AndroidArtifactStub{"
+ "myOutputs="
+ myOutputs
+ ", myApplicationId='"
+ myApplicationId
+ '\''
+ ", mySourceGenTaskName='"
+ mySourceGenTaskName
+ '\''
+ ", myGeneratedResourceFolders="
+ myGeneratedResourceFolders
+ ", myInstantRun="
+ myInstantRun
+ ", mySigningConfigName='"
+ mySigningConfigName
+ '\''
+ ", myAbiFilters="
+ myAbiFilters
+ ", mySigned="
+ mySigned
+ ", myInstrumentedTestTaskName="
+ myInstrumentedTestTaskName
+ ", myBundleTaskName="
+ myBundleTaskName
+ "} "
+ ", myPostBundleTasModelFile="
+ myPostBundleTaskModelFile
+ "} "
+ ", myApkFromBundleTaskName"
+ myApkFromBundleTaskName
+ "} "
+ ", myPostApkFromBundleTaskModelFile="
+ myPostApkFromBundleTaskModelFile
+ "} "
+ super.toString();
}
}
|
3e075be7719ba62191c886930c6043a7a4af306b
| 1,608 |
java
|
Java
|
src/main/java/kuroodo/swagbot/command/Command.java
|
kuroodo/SwagBot-2.0
|
6ced6fd6ab739c4076487bfc1d3aaad5e3f7026d
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/kuroodo/swagbot/command/Command.java
|
kuroodo/SwagBot-2.0
|
6ced6fd6ab739c4076487bfc1d3aaad5e3f7026d
|
[
"Apache-2.0"
] | null | null | null |
src/main/java/kuroodo/swagbot/command/Command.java
|
kuroodo/SwagBot-2.0
|
6ced6fd6ab739c4076487bfc1d3aaad5e3f7026d
|
[
"Apache-2.0"
] | null | null | null | 30.339623 | 89 | 0.765547 | 3,116 |
/*
* Copyright 2019 Leandro Gaspar
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 kuroodo.swagbot.command;
import java.util.ArrayList;
import net.dv8tion.jda.api.Permission;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
public abstract class Command {
protected ArrayList<Permission> requiredPermissions = new ArrayList<Permission>();
public String commandPrefix = "";
/**
* Specify any permissions required for normal command function
*/
protected abstract void setCommandPermissiosn();
/**
* Begin executing command function. Call this method to begin a commands
* execution
*
* @param commandParams Parameters from user input required for command function
* @param event The event that initiated the command
*/
public abstract void executeCommand(String[] commandParams, MessageReceivedEvent event);
/**
* Returns a tooltip of what the command does
*/
public abstract String commandDescription();
/**
* Returns a tooltip of the proper command format
*/
public abstract String commandFormat();
public abstract String commandUsageExample();
}
|
3e075cb898efb97b35e12cc3fc2c6912702ea365
| 1,158 |
java
|
Java
|
service.impl/src/main/java/com/hack23/cia/service/impl/action/user/wordcount/WordCounter.java
|
TrisA/cia
|
c67d638ec50b47afb9a033eae6e350fa514a0469
|
[
"Apache-2.0"
] | 75 |
2015-08-01T15:31:54.000Z
|
2022-03-19T12:07:06.000Z
|
service.impl/src/main/java/com/hack23/cia/service/impl/action/user/wordcount/WordCounter.java
|
TrisA/cia
|
c67d638ec50b47afb9a033eae6e350fa514a0469
|
[
"Apache-2.0"
] | 2,662 |
2016-12-16T17:27:08.000Z
|
2022-03-28T09:32:36.000Z
|
service.impl/src/main/java/com/hack23/cia/service/impl/action/user/wordcount/WordCounter.java
|
TrisA/cia
|
c67d638ec50b47afb9a033eae6e350fa514a0469
|
[
"Apache-2.0"
] | 38 |
2017-03-03T23:15:18.000Z
|
2021-12-31T19:07:13.000Z
| 27.571429 | 97 | 0.724525 | 3,117 |
/*
* Copyright 2010-2021 James Pether Sörling
*
* 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.
*
* $Id$
* $HeadURL$
*/
package com.hack23.cia.service.impl.action.user.wordcount;
import java.util.Map;
import com.hack23.cia.model.external.riksdagen.documentcontent.impl.DocumentContentData;
/**
* The Interface WordCounter.
*/
public interface WordCounter {
/**
* Calculate word count.
*
* @param documentContentData
* the document content data
* @param maxResult
* the max result
* @return the map
*/
Map<String, Integer> calculateWordCount(DocumentContentData documentContentData, int maxResult);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.