Go+Python双语言混合开发


本文摘自网络,作者,侵删。

Go+Python双语言混合开发


V:ititit111222333

 * 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.appium.java_client.android.appmanagement;  import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; import static java.util.Optional.ofNullable;  import com.google.common.collect.ImmutableMap;  import io.appium.java_client.appmanagement.BaseInstallApplicationOptions;  import java.time.Duration; import java.util.Map;  public class AndroidInstallApplicationOptions extends         BaseInstallApplicationOptions<AndroidInstallApplicationOptions> {     private Boolean replace;     private Duration timeout;     private Boolean allowTestPackages;     private Boolean useSdcard;     private Boolean grantPermissions;      /**      * Enables the possibility to upgrade/reinstall the application      * if it is already present on the device (the default behavior).      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withReplaceEnabled() {         this.replace = true;         return this;     }      /**      * Disables the possibility to upgrade/reinstall the application      * if it is already present on the device.      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withReplaceDisabled() {         this.replace = false;         return this;     }      /**      * The time to wait until the app is installed (60000ms by default).      *      * @param timeout the actual timeout value. The minimum time resolution      *                unit is one millisecond.      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withTimeout(Duration timeout) {         checkArgument(!checkNotNull(timeout).isNegative(), "The timeout value cannot be negative");         this.timeout = timeout;         return this;     }      /**      * Allows to install packages marked as test in the manifest.      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withAllowTestPackagesEnabled() {         this.allowTestPackages = true;         return this;     }      /**      * Disables a possibility to install packages marked as test in      * the manifest (the default setting).      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withAllowTestPackagesDisabled() {         this.allowTestPackages = false;         return this;     }      /**      * Forces the application to be installed of SD card      * instead of the internal memory.      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withUseSdcardEnabled() {         this.useSdcard = true;         return this;     }      /**      * Forces the application to be installed to the internal memory      * (the default behavior).      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withUseSdcardDisabled() {         this.useSdcard = false;         return this;     }      /**      * Grants all the permissions requested in the      * application's manifest automatically after the installation      * is completed under Android 6+.      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withGrantPermissionsEnabled() {         this.grantPermissions = true;         return this;     }      /**      * Does not grant all the permissions requested in the      * application's manifest automatically after the installation      * is completed (the default behavior).      *      * @return self instance for chaining.      */     public AndroidInstallApplicationOptions withGrantPermissionsDisabled() {         this.grantPermissions = false;         return this;     }      @Override     public Map<String, Object> build() {         final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();         ofNullable(replace).map(x -> builder.put("replace", x));         ofNullable(timeout).map(x -> builder.put("timeout", x.toMillis()));         ofNullable(allowTestPackages).map(x -> builder.put("allowTestPackages", x));         ofNullable(useSdcard).map(x -> builder.put("useSdcard", x));         ofNullable(grantPermissions).map(x -> builder.put("grantPermissions", x));         return builder.build();     } }



本文来自:51CTO博客

感谢作者:mb5fdf56b9cf058

查看原文:Go+Python双语言混合开发

相关阅读 >>

Golang如何判断channel已经close

基于web的局域网文件管理系统

Go语言proto使用入门

吊打jd_seckill,Go语言版免配置抢茅台程序,实力接盘~

Golang怎么判断map是否为空

Golang 创建型设计模式 建造者模式

Golang入门一:变量

windows下如何玩转火热的Go-zero

Golang和nodejs的区别是什么?

聊聊dubbo-Go-proxy的jtypes

更多相关阅读请进入《Go》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...